Re: [WebDNA] unix timestamp in WebDNA
This WebDNA talk-list message is from 2009
It keeps the original formatting.
numero = 102082
interpreted = N
texte = Dana,I should explain, this is for the number of seconds since 1/1/1970 (Unixepoch). To work for your application simply relace [date] with yourdate from the db, making sure it's format is MM/DD/YYYY.Marc Thompson wrote:> Here's an estimation within a few seconds:> [text]timestamp=[math]((([math]{[date]}[/math])-1)*86400)+([math]{[time]}[/math])[/math][/text]> [math show=f]time_now=[timestamp]*1[/math]> [math show=t]Aprox_Epoch_Time=[time_now]-62167107589[/math]> > > Marc> > Dana Keil wrote:>> On Feb 27, 2009, at 11:59 AM, Donovan Brooke wrote:>>>>> It would help if you describe your project a bit.>> Hi Donovan,>>>> Once I started getting answers (thanks everyone), I realized that what>> I'm wanting it for isn't obvious, who would have thought my question>> could be interpreted in so many different ways -- I know exactly what>> I'm thinking, why doesn't everyone else ;-).>>>> I have a site that is currently a "hybrid" WebDNA and PHP site (for>> historical reasons). I write WebDNA pages that return info to PHP when>> PHP uses cURL to hit the WebDNA page (and PHP can send info to WebDNA>> using cURL too, it works both ways quite nicely).>>>> The PHP wants to do some math on a date value that comes from WebDNA>> (stored as MM/DD/YYYY in a WebDNA db) and I would like to convert that>> to a unix timestamp form before passing it to PHP. If it was native>> WebDNA, of course, I wouldn't care about getting it into unix timestamp>> form at all.>>>> So the question is, does anyone have an already written function that>> will take a value coming from a WebDNA db in the MM/DD/YYYY format and>> turn it into a unix time number.>>>> -->> Dana>>>>> -- -------------------------------------------Marc ThompsonSoftware EngineerOffice of Information TechnologyUniversity of Utah801.585.9264marc.thompson@utah.edu-------------------------------------------
Associated Messages, from the most recent to the oldest:
Dana,I should explain, this is for the number of seconds since 1/1/1970 (Unixepoch). To work for your application simply relace
[date] with yourdate from the db, making sure it's format is MM/DD/YYYY.Marc Thompson wrote:> Here's an estimation within a few seconds:>
[text]timestamp=
[math](((
[math]{
[date]}[/math])-1)*86400)+(
[math]{
[time]}[/math])[/math][/text]> [math show=f]time_now=[timestamp]*1[/math]> [math show=t]Aprox_Epoch_Time=[time_now]-62167107589[/math]> > > Marc> > Dana Keil wrote:>> On Feb 27, 2009, at 11:59 AM, Donovan Brooke wrote:>>>>> It would help if you describe your project a bit.>> Hi Donovan,>>>> Once I started getting answers (thanks everyone), I realized that what>> I'm wanting it for isn't obvious, who would have thought my question>> could be interpreted in so many different ways -- I know exactly what>> I'm thinking, why doesn't everyone else ;-).>>>> I have a site that is currently a "hybrid" WebDNA and PHP site (for>> historical reasons). I write WebDNA pages that return info to PHP when>> PHP uses cURL to hit the WebDNA page (and PHP can send info to WebDNA>> using cURL too, it works both ways quite nicely).>>>> The PHP wants to do some math on a date value that comes from WebDNA>> (stored as MM/DD/YYYY in a WebDNA db) and I would like to convert that>> to a unix timestamp form before passing it to PHP. If it was native>> WebDNA, of course, I wouldn't care about getting it into unix timestamp>> form at all.>>>> So the question is, does anyone have an already written function that>> will take a value coming from a WebDNA db in the MM/DD/YYYY format and>> turn it into a unix time number.>>>> -->> Dana>>>>> -- -------------------------------------------Marc ThompsonSoftware EngineerOffice of Information TechnologyUniversity of Utah801.585.9264marc.thompson@utah.edu-------------------------------------------
Marc Thompson
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:
X etc.... (1999)
Rollovers (1999)
Re[2]: 2nd WebCatalog2 Feature Request (1996)
[BULK] Fwd: [WebDNA] [BULK] WebDNA discovery in the Console - [having many crashes] (2011)
Exclamation point (1997)
problems with 2 tags (1997)
Simple Store (2000)
emailer (1997)
[WebDNA] Is the AutoCommit preference still supported? (2010)
two unique banners on one page (1997)
SendTo more emails (1998)
Unzip (2005)
ReadDateFormat bug in 3.0.1 (1998)
shipcost (1997)
ShowNext Command (1997)
This is an odd error (2001)
[protect admin] (1997)
OT: IP addres checking (2003)
docs for WebCatalog2 (1997)
interactive .pdf files and WebCatalog (2000)