How to show users the current date and time: Difference between revisions

From Lifeguide Wiki
Jump to navigation Jump to search
(Created page with "On the page that you would like to show the current date and time, you will need to create a '''printed variable'''. Please click on the category link at the bottom of this pa...")
 
No edit summary
 
Line 6: Line 6:
set page1.displaytime to printtime (currenttime, "H:m d-M-y") </code>
set page1.displaytime to printtime (currenttime, "H:m d-M-y") </code>


Please see the tutorial intervention 'Time and Date' on the LifeGuide Community Website for a demo of this function and how it can be used in other ways.  
Time can be printed in many different formats - for example:
 
<code>show page1
set page1.displaytime to printtime (currenttime(), "'It is 'H'hrs, 'm' minutes and 's' seconds past midnight on 'E")</code>
 
will display something like:
 
''It is 14hrs, 30 minutes and 56 seconds past midnight on Tue''
 
For a more detailed description and all the formats of time supported, see [[Logic_Dictionary#printtime]]. Please see the tutorial intervention 'Time and Date' on the LifeGuide Community Website for a demo of this function and how it can be used in other ways.  
 
 


[[Category:printed variable]]
[[Category:printed variable]]
[[Category:currenttime]]
[[Category:currenttime]]

Latest revision as of 13:40, 2 September 2016

On the page that you would like to show the current date and time, you will need to create a printed variable. Please click on the category link at the bottom of this page for the link showing you how to do this.

In this example, we will call the printed variable displaytime and it will be shown on page1:

show page1 set page1.displaytime to printtime (currenttime, "H:m d-M-y")

Time can be printed in many different formats - for example:

show page1 set page1.displaytime to printtime (currenttime(), "'It is 'H'hrs, 'm' minutes and 's' seconds past midnight on 'E")

will display something like:

It is 14hrs, 30 minutes and 56 seconds past midnight on Tue

For a more detailed description and all the formats of time supported, see Logic_Dictionary#printtime. Please see the tutorial intervention 'Time and Date' on the LifeGuide Community Website for a demo of this function and how it can be used in other ways.