Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
leading zeros in ToSTr
Hi Gintaras,
In using DateTime functions I use this:

Macro Macro12
Copy      Help
DateTime x
out x.ToStr(1)

however it outputs day and month without leading zeros.
In sqlite, it is better for date time functions such as strftime to be in format with leading zeros
even better to have it in this format YYYY-MM-DD to use the sqlite date and datetime functions more directly without having to specify format with strftime
I know there are some formatting options that indicate no leading zero but they don't seem to work with my version of sqlite (the qm recommended sqlite.dll).
Any thoughts.
How would you convert the output from above (e.g. 9/3/2012) to YYYY-MM-DD format easily.
Thanks, S
Macro Macro1793
Copy      Help
DateTime x
out x.ToStrFormat("{yyyy-MM-dd}")
great that's perfect!

Forum Jump:

Users browsing this thread: 1 Guest(s)