Re: datetime functions

new topic     » goto parent     » topic index » view thread      » older message » newer message

ChrisBurch2 wrote:
> 
> Hi
> 
> Phew, having difficulty keeping up.
> 
> Can I take a date string, (24/05/2008), add 47 days, and get a date string
> back?
> 
> Note the UK localisation!
> 

Chris,

There are two skeleton functions (no code yet). format and parse. You will have
to do something like:

datetime dt
dt = d:parse(date, "%d/%m/%Y")
dt = d:add(dt, 47, DAYS)
puts(1, d:format(dt, "%d/%m/%Y")


Of course, you could create constants for the date/time format.

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu