Message Boards Message Boards

Deploy a updating countdown-to-event web page ?

I'm very new to the language and as a simple project I'd like to create a Countdown page, so that each time I visit it the page displays the latest information.

I intend a page full of lines such as ... "Days to Dorset 100"

DayCount[{2016, 5, 28}, Now]]

I can CloudDeploy the line above, but how about a full page of, say, 20 such lines?

And will the url provided by CloudDeploy update each time it is accessed?

Thanks for your help,

Garfield

enter image description here

You need Delayed - it represents an expression whose evaluation is delayed until its value is externally requested. I used seconds so you can see the numbers are different every time you access the page.

CloudDeploy[Delayed[Column[{
Style[ToString[AccountingForm[Round[DateDifference[Now,{2017,1,1},"Second"]]]]<>
" seconds to New Year",20,FontFamily->"American Typewriter"],
Style[ToString[AccountingForm[Round[DateDifference[Now,{2016,12,25},"Second"]]]]<>
" seconds to Christmas",20,FontFamily->"American Typewriter"]
}]]]
POSTED BY: Vitaliy Kaurov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract