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. ThanksOn 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:
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. ThanksOn 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:
Email (1998)
Shopping carts and reloading pages (1997)
Shopping Carts (2000)
Sending Email (2004)
Categories (2000)
2.0 Info (1997)
WebCatalog2 Feature Feedback (1996)
[carts] and databases (1997)
Show shoppingcart after remove last item (1997)
WebCat Mac OS X and Encrypt Help Need (2000)
summ=T (2003)
[showif]/[hideif] question (1997)
Setting up shop (1997)
YACBQ.....(Yet another checkbox question) (2000)
WebCatalog Hosting (1996)
WebMerchant 1.6 and SHTML (1997)
I can help! (1996)
Version f1 status (1997)
Another search question please... (1998)
F3 crashing server (1997)