Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Insert formatted date
#2
1. Declare str variable.
2. With that variable, call function time with formatting string.
3. Paste that variable.

Example1 - month/day/year
Code:
Copy      Help
str s
s.time("d")
out s

More date-time formatting examples

Example2 - date
Code:
Copy      Help
out s.time("%x")

Example3 - date and time
Code:
Copy      Help
out s.time("%c")

Example4 - short-weekday short-month day hour:min
Code:
Copy      Help
out s.time("%a %b %#d %H:%M")


As you see, %x is replaced to date, %#d to day, etc.
Characters that aren't preceded by % (in example - spaces and colon) are unchanged.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)