Wolfram Archive
Wolfram Programming Lab is a legacy product.
All the same functionality and features, including access to Programming Lab Explorations, are available with Wolfram|One.
Start programming now. »
Try it now »
(no sign-in required)

Powers of Ten History

Find when it was 10, 100, 1,000, 10,000, etc. days ago.

Run the code to find the current date:

SHOW/HIDE DETAILS

This gives todays date:

Today

You can also get yesterdays date and tomorrows:

Yesterday
Tomorrow

HIDE DETAILS
Today

Find the date exactly 100 days ago. Try other numbers of days:

SHOW/HIDE DETAILS

DatePlus adds a number of days to a date.

This gives the date 10 days from now:

DatePlus[Today, 10]

This gives the date 100 days ago:

DatePlus[Today, -100]

HIDE DETAILS
DatePlus[Today, -100]

Make a table of the first 9 powers of 10. Try different numbers of powers:

SHOW/HIDE DETAILS

Were going to want to look at dates in powers of 10.

This is how to use Table to make a list of the first 9 powers of 10:

Table[10^n, {n, 9}]

HIDE DETAILS
Table[10^n, {n, 9}]

Make a table of powers of 10 dates. Try more than 5 dates:

SHOW/HIDE DETAILS

This makes a list of dates in increasing powers of 10 days ago:

Table[DatePlus[Today, -10^n], {n, 5}]

Use DateString to format the date objects as text strings.

This gives today as a date object:

Today

This converts the date object to a text string:

DateString[Today, "Date"]

Make every element of the date list a text string:

Table[DateString[DatePlus[Today, -10^n], "Date"], {n, 5}]

Format the list as a column (you can use either the ...//Column form or the Column[...] form; they mean the same thing):

Table[DateString[DatePlus[Today, -10^n], "Date"], {n, 5}] // Column

HIDE DETAILS
Table[DateString[DatePlus[Today, -10^n], "Date"], {n, 5}] // Column

Include the number of days in a table. Try ranges other than 5:

Note: if you change the increment from 10, you have to change both occurrences of 10.

SHOW/HIDE DETAILS

This makes a list of lists. Each sublist has a number of days, and the date that many days ago:

Table[{10^n, DateString[DatePlus[Today, -10^n], "Date"]}, {n, 5}]

Format the list of lists as a grid. Each sublist is a row in the grid:

Grid[Table[{10^n, DateString[DatePlus[Today, -10^n], "Date"]}, {n, 5}]]

Use FrameAll to add frame lines:

Grid[Table[{10^n, DateString[DatePlus[Today, -10^n], "Date"]}, {n, 5}], Frame -> All]

HIDE DETAILS
Grid[Table[{10^n, DateString[DatePlus[Today, -10^n], "Date"]}, {n, 5}], Frame -> All]

Share ItMake a website that gives powers of ten tables for dates:

SHOW/HIDE DETAILS

Deploy a form that gives you a power of ten table for a date you specify:

CloudDeploy[FormFunction[{"date" -> "Date"}, Grid[Table[{10^n, DateString[DatePlus[#date, -10^n], "Date"]}, {n, 5}], Frame -> All] &, "PNG"], "Permissions" -> "Public" ]

Click on the link in the output to visit the site.

Tell the world about your creation by sharing the link via email, tweet, or other message.

HIDE DETAILS
CloudDeploy[FormFunction[{"date" -> "Date"}, Grid[Table[{10^n, DateString[DatePlus[#date, -10^n], "Date"]}, {n, 5}], Frame -> All] &, "PNG"], "Permissions" -> "Public" ]