Re: [WebDNA] Need to convert unix date?
This WebDNA talk-list message is from 2009
It keeps the original formatting.
numero = 104183
interpreted = N
texte = What is your date format set to in your WebDNA admin? Mine is "Month/Date/Year (American)"?-Dan Stronghttp://www.DanStrong.comOn 12/16/2009 1:55 PM, David Bastedo wrote:> So when I put that code on my server, I get 3909 as the year. I have> tried it on two different servers, so I am not sure what is up.>> -----> [math]val=1252257406*1[/math] = [math date]{01/01/1970} + {[format> days_to_date %m/%d/%Y][format> .6d][math]([val]/86400)[/math][/format][/format]}[/math]> 1252257406=09/06/3909>> I have deconstructed the original time stamp to:>>> [Math> show=f]subTotal=[Math]{09/14/2009}[/math]-[Math]{01/01/1970}[/math][/math]> total time + days + 1 day - 5 hours> =[math]([subTotal]*86400)+{06:08:54}+86400-18000[/math]=> [reaction_published]>> so technically, if I do this in the reverse, I should get what I need . . .>> d.>>>>>>> On Wed, Dec 16, 2009 at 4:01 PM, Marc Thompson
> wrote:>> Not sure what the "+1" is for from Dan's example besides adding an extra> day? However, I put the code on my server so you could see it working.> http://webapps.utah.edu/test/temp.tpl>> Seems to work fine on my server, which is -7DST.>> You would need to add some more formatting code to get it in the form> you show in your previous post.> ie. The timestamp 1252976934 corresponds to 2009/09/14 06:08:54 pm PDT.>> Marc>> David Bastedo wrote:> > Unfortunately, I get: 09/16/3909 with the code below:> >> > I'm trying to work through this . . .> >> > d.> >> >> > On Wed, Dec 16, 2009 at 11:17 AM, Marc Thompson> > > >>> wrote:> >> > Here you go:> >> > [math]val=1252976934*1[/math] = [math date]{01/01/1970} +> {[format> > days_to_date %m/%d/%Y][format> > .6d][math]([val]/86400)+1[/math][/format][/format]}[/math]> >> > Marc> >> > David Bastedo wrote:> > > The timestamp *1252976934* corresponds to* 2009/09/14 06:08:54 pm> > PDT*.> > >> > > this is the time stamp: *1252976934*> > >> > > [format days_to_date %m/%d/%Y][format> > > .6d][math]([your_UNIX_timestamp]/86400)+1[/math][/format][/format]> > >> > > gets me: 09/16/39> > >> > > d.> > >> > > On Tue, Dec 15, 2009 at 6:54 PM, Dan Strong> > > >> > > > >>> wrote:> > >> > > Try this:> > >> > > [format days_to_date %m/%d/%Y][format> > >> .6d][math]([your_UNIX_timestamp]/86400)+1[/math][/format][/format]> > >> > >> > >> > > On 12/15/2009 3:47 PM, David Bastedo wrote:> > >> > > Hi, I need to convert a date stored in unix format -> seconds> > > since Jan> > > 01, 1970. Is there a formula or function that anybody> > might have?> > >> > > I am pulling in an xml file generated by an external> api and> > > that date> > > comes in this format.> > >> > > thanks.> > >> > > d.> > >> > >> > > --> > > David Bastedo> > > Ten Plus One Communications Inc.> > > http://www.10plus1.com> > > T. 416.603.2223> > > M. 416.277.4499> > >> > > ---------------------------------------------------------> > > 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> > > old archives: http://dev.webdna.us/TalkListArchive/> > > Bug Reporting:> > > http://forum.webdna.us/eucabb.html?page=topics&category=288> > > >> > > > > >>> > >> > >> > >> > >> > > --> > > David Bastedo> > > Ten Plus One Communications Inc.> > > http://www.10plus1.com> > > T. 416.603.2223> > > M. 416.277.4499> >> > --> > -------------------------------------------> > Marc Thompson> > Software Engineer> > Office of Information Technology> > University of Utah> > 801.585.9264> > marc.thompson@utah.edu > >> > -------------------------------------------> >> >> >> >> > --> > David Bastedo> > Ten Plus One Communications Inc.> > http://www.10plus1.com> > T. 416.603.2223> > M. 416.277.4499>> --> -------------------------------------------> Marc Thompson> Software Engineer> Office of Information Technology> University of Utah> 801.585.9264> marc.thompson@utah.edu > ------------------------------------------->>>>> --> David Bastedo> Ten Plus One Communications Inc.> http://www.10plus1.com> T. 416.603.2223> M. 416.277.4499
Associated Messages, from the most recent to the oldest:
What is your date format set to in your WebDNA admin? Mine is "Month/Date/Year (American)"?-Dan Stronghttp://www.DanStrong.comOn 12/16/2009 1:55 PM, David Bastedo wrote:> So when I put that code on my server, I get 3909 as the year. I have> tried it on two different servers, so I am not sure what is up.>> -----> [math]val=1252257406*1[/math] = [math date]{01/01/1970} + {[format> days_to_date %m/%d/%Y][format> .6d][math]([val]/86400)[/math][/format][/format]}[/math]> 1252257406=09/06/3909>> I have deconstructed the original time stamp to:>>> [Math> show=f]subTotal=[math]{09/14/2009}[/math]-[math]{01/01/1970}[/math][/math]> total time + days + 1 day - 5 hours> =[math]([subTotal]*86400)+{06:08:54}+86400-18000[/math]=> [reaction_published]>> so technically, if I do this in the reverse, I should get what I need . . .>> d.>>>>>>> On Wed, Dec 16, 2009 at 4:01 PM, Marc Thompson > wrote:>> Not sure what the "+1" is for from Dan's example besides adding an extra> day? However, I put the code on my server so you could see it working.> http://webapps.utah.edu/test/temp.tpl>> Seems to work fine on my server, which is -7DST.>> You would need to add some more formatting code to get it in the form> you show in your previous post.> ie. The timestamp 1252976934 corresponds to 2009/09/14 06:08:54 pm PDT.>> Marc>> David Bastedo wrote:> > Unfortunately, I get: 09/16/3909 with the code below:> >> > I'm trying to work through this . . .> >> > d.> >> >> > On Wed, Dec 16, 2009 at 11:17 AM, Marc Thompson> > > >>> wrote:> >> > Here you go:> >> > [math]val=1252976934*1[/math] = [math date]{01/01/1970} +> {[format> > days_to_date %m/%d/%Y][format> > .6d][math]([val]/86400)+1[/math][/format][/format]}[/math]> >> > Marc> >> > David Bastedo wrote:> > > The timestamp *1252976934* corresponds to* 2009/09/14 06:08:54 pm> > PDT*.> > >> > > this is the time stamp: *1252976934*> > >> > > [format days_to_date %m/%d/%Y][format> > > .6d][math]([your_UNIX_timestamp]/86400)+1[/math][/format][/format]> > >> > > gets me: 09/16/39> > >> > > d.> > >> > > On Tue, Dec 15, 2009 at 6:54 PM, Dan Strong> > > >> > > > >>> wrote:> > >> > > Try this:> > >> > > [format days_to_date %m/%d/%Y][format> > >> .6d][math]([your_UNIX_timestamp]/86400)+1[/math][/format][/format]> > >> > >> > >> > > On 12/15/2009 3:47 PM, David Bastedo wrote:> > >> > > Hi, I need to convert a date stored in unix format -> seconds> > > since Jan> > > 01, 1970. Is there a formula or function that anybody> > might have?> > >> > > I am pulling in an xml file generated by an external> api and> > > that date> > > comes in this format.> > >> > > thanks.> > >> > > d.> > >> > >> > > --> > > David Bastedo> > > Ten Plus One Communications Inc.> > > http://www.10plus1.com> > > T. 416.603.2223> > > M. 416.277.4499> > >> > > ---------------------------------------------------------> > > 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> > > old archives: http://dev.webdna.us/TalkListArchive/> > > Bug Reporting:> > > http://forum.webdna.us/eucabb.html?page=topics&category=288> > > >> > > > > >>> > >> > >> > >> > >> > > --> > > David Bastedo> > > Ten Plus One Communications Inc.> > > http://www.10plus1.com> > > T. 416.603.2223> > > M. 416.277.4499> >> > --> > -------------------------------------------> > Marc Thompson> > Software Engineer> > Office of Information Technology> > University of Utah> > 801.585.9264> > marc.thompson@utah.edu > >> > -------------------------------------------> >> >> >> >> > --> > David Bastedo> > Ten Plus One Communications Inc.> > http://www.10plus1.com> > T. 416.603.2223> > M. 416.277.4499>> --> -------------------------------------------> Marc Thompson> Software Engineer> Office of Information Technology> University of Utah> 801.585.9264> marc.thompson@utah.edu > ------------------------------------------->>>>> --> David Bastedo> Ten Plus One Communications Inc.> http://www.10plus1.com> T. 416.603.2223> M. 416.277.4499
Dan Strong
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:
WebCat2 beta 11 - new prefs ... (1997)
WebCat2 - [include] tags (1997)
Help ! Frustrating Problem (1999)
WebCatalog 3.0.8 is on FTP... (2000)
[TaxableTotal] - not working with AOL and IE (1997)
whole word matching (2004)
Tab Charactor (1997)
Thanks Grant (1997)
WebCat b13 CGI -shownext- (1997)
[WebDNA] IIS 6.0 Custom Errors & WebDNA 6.2 (2009)
[convertchars] HELP!!! (1999)
Bug Report, maybe (1997)
triggers.db (1999)
WebCat on Alpha? (1997)
Help! Error: Help! I'm stuck: Can't open order file. Ignoring [OrderFile] context (2000)
WebDNA version? (2007)
2.0Beta Command Ref (can't find this instruction) (1997)
Emailer and Lack of Code Commenting (1999)
Flash Stores (2003)
syntax question, not in online refernce (1997)