Re: [WebDNA] timestamp conversion

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 107012
interpreted = N
texte = That looks really cool....thanks. Specifically though, I'm working with RSS feeds where this is the standard time format. I can generate the same with the [date] + format abbreviations. I was just hoping there might be a secret trick to essentially do a backwards format conversion natively. something like...... [unformat date %a, %d %b %Y %X]Wed, 08 Jun 2011 18:46:44[/unformat] (obviously a product of my imagination) I created a function to do what I need though. Thanks On 7/20/11 2:59 PM, Marc Thompson wrote: > The best way is to create and save the time stamp is as a number. For > example: (86400 is the seconds in 24 hours) > [text]timestamp=[math]((([math]{[date]}[/math])-1)*86400)+([math]{[time]}[/math])[/math][/text] > > > Then to display this numerical value, use WebDNA's [format] context. > To get the date: > [format days_to_date][format > .6d][math]([timestamp]/86400)+1[/math][/format][/format] > > To get the time: > [format seconds_to_time][math][timestamp]-(86400*[format > ..6d][math]([timestamp]/86400)[/math][/format])[/math][/format] > OR to format is differently use > [format Seconds_To_Time %I:%M:%S %p] > > Marc > > On 7/20/2011 10:05 AM, Aaron Michael Kaczmarek wrote: >> Does anyone have a script that will generate standard timestamps? >> i.e. Wed, 08 Jun 2011 18:46:44 +0000 >> >> as well as the reverse, to convert this timestamp into webdna format? >> (this is really what I'm interested in) >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list. >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> Bug Reporting: support@webdna.us >> . >> > Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] timestamp conversion (Aaron Michael Kaczmarek 2011)
  2. Re: [WebDNA] timestamp conversion (Kenneth Grome 2011)
  3. Re: [WebDNA] timestamp conversion (Marc Thompson 2011)
  4. Re: [WebDNA] timestamp conversion (Donovan Brooke 2011)
  5. [WebDNA] timestamp conversion (Aaron Michael Kaczmarek 2011)
That looks really cool....thanks. Specifically though, I'm working with RSS feeds where this is the standard time format. I can generate the same with the [date] + format abbreviations. I was just hoping there might be a secret trick to essentially do a backwards format conversion natively. something like...... [unformat date %a, %d %b %Y %X]Wed, 08 Jun 2011 18:46:44[/unformat] (obviously a product of my imagination) I created a function to do what I need though. Thanks On 7/20/11 2:59 PM, Marc Thompson wrote: > The best way is to create and save the time stamp is as a number. For > example: (86400 is the seconds in 24 hours) > [text]timestamp=[math]((([math]{[date]}[/math])-1)*86400)+([math]{[time]}[/math])[/math][/text] > > > Then to display this numerical value, use WebDNA's [format] context. > To get the date: > [format days_to_date][format > .6d][math]([timestamp]/86400)+1[/math][/format][/format] > > To get the time: > [format seconds_to_time][math][timestamp]-(86400*[format > ..6d][math]([timestamp]/86400)[/math][/format])[/math][/format] > OR to format is differently use > [format Seconds_To_Time %I:%M:%S %p] > > Marc > > On 7/20/2011 10:05 AM, Aaron Michael Kaczmarek wrote: >> Does anyone have a script that will generate standard timestamps? >> i.e. Wed, 08 Jun 2011 18:46:44 +0000 >> >> as well as the reverse, to convert this timestamp into webdna format? >> (this is really what I'm interested in) >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list. >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> Bug Reporting: support@webdna.us >> . >> > Aaron Michael Kaczmarek

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Any help gratefully appreciated (2001) Re[3]: 2nd WebCatalog2 Feature Request (1996) A Global Variable (1997) View Source from cache (1997) Multi-processor Mac info ... (1997) E-mail Attachments (1997) [WebDNA] sort parameters in search (2015) Re:Multiple appends with checkboxes (1998) anyone integrated inventory w/ storebuilder? (2003) hiding hyperlink info in URL field (1999) [WebDNA] products.db (2013) Shopping cart now bad (1997) Forumulas.db & Variables (2002) SubCategorizing (2000) Multiple security dbs (1997) View Source from cache (1997) Error.html (1997) math with a [numfound] (2005) RE: Include (1998) Suggestion: appendfounditems (2002)