Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 Tags
Subject: RE: Convert Datetime do Timestamp
Thread ID: 207330 Message ID: 207680 # Views: 24 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Monday, December 15, 2008 5:20:56 PM         
   


> >
> >
> > Hi Yousfi,
> > As I said earlier to Peter "A timestamp differs between systems by definition". It would be "the number of seconds since 1/1/1970 at 00:00:00" even if anywhere someone said "Unix time". I didn't see anyone in this thread mentioning Unix time, did you?
> > A timestamp is something you would get N definitions if you ask to N different sources. Peter was asking something with a higher precision than datetime. Seconds have a lower resolution than datetime.
> > Another definition of timestamp is like ttoc(,3).
> >
> > Timestamp in foxpro that you see in scx,vcx,frx ... have a definition unique to VFP itself based on reference date from 1980. You can't simply threat it as seconds value (and actually it stores in 2 seconds increments) but need to dissect bitwise. You can check the GetFrxTimeStamp code of FFC\_frxCursor.vcx, frxCursor class.
> >
> > Cetin Basoz
>
> Thank you Cetin.I find _frxCursor in FFC.
> if i say you the date reference of vfp system is december 6 ,1979 11:15:12 PM !
>
> that is my code:
>
> *FOX system file timestamp 
> LOCAL  oFrxCursor
> oFrxCursor = NewObject("FrxCursor", home()+"\ffc\_FrxCursor")
> x1="VFP timestamp of actual dateTime   = "+trans(oFRXCursor.getFrxTimeStamp() )
> x2="VFP timestamp of 01/01/1980        = "+trans(oFRXCursor.getFrxTimeStamp(dateTime(1980,1,1,0,0,0)))
> 
> x3="VFP timestamp real reference       = "+ttoc(dateTime(1980,1,1,0,0,0)-oFRXCursor.getFrxTimeStamp(ctod("01/01/1980")))
> messagebox(x1+chr(13)+x2+chr(13)+x3,0+32,"FOX system file timestamp ")
> 

> regards

CTOD("01/01/1980") shouldn't be used; it's basically ambiguous and SET DATE dependant.
-Anders

COMPLETE THREAD

Convert Datetime do Timestamp Posted by Peter Wagner @ 12/12/2008 10:44:40 PM
RE: Convert Datetime do Timestamp Posted by Mark Letheren @ 12/12/2008 11:24:38 PM
RE: Convert Datetime do Timestamp Posted by Cetin Basoz @ 12/12/2008 11:30:22 PM
RE: Convert Datetime do Timestamp Posted by Peter Wagner @ 12/13/2008 12:58:07 AM
RE: Convert Datetime do Timestamp Posted by Anders Altberg @ 12/13/2008 1:06:12 AM
RE: Convert Datetime do Timestamp Posted by Peter Wagner @ 12/13/2008 5:30:19 AM
RE: Convert Datetime do Timestamp Posted by Anders Altberg @ 12/13/2008 5:46:43 PM
RE: Convert Datetime do Timestamp Posted by Anders Altberg @ 12/13/2008 1:10:26 AM
RE: Convert Datetime do Timestamp Posted by Cetin Basoz @ 12/13/2008 4:52:26 PM
RE: Convert Datetime do Timestamp Posted by Yousfi Benameur @ 12/15/2008 1:54:44 AM
RE: Convert Datetime do Timestamp Posted by Cetin Basoz @ 12/15/2008 1:02:39 PM
RE: Convert Datetime do Timestamp Posted by Yousfi Benameur @ 12/15/2008 5:14:18 PM
RE: Convert Datetime do Timestamp Posted by Anders Altberg @ 12/15/2008 5:20:56 PM
RE: Convert Datetime do Timestamp Posted by Yousfi Benameur @ 12/15/2008 7:10:47 PM
RE: Convert Datetime do Timestamp Posted by Cetin Basoz @ 12/15/2008 5:48:21 PM
RE: Convert Datetime do Timestamp Posted by Yousfi Benameur @ 12/13/2008 12:39:05 AM
RE: Convert Datetime do Timestamp Posted by Peter Wagner @ 12/13/2008 1:05:05 AM
RE: Convert Datetime do Timestamp Posted by Yousfi Benameur @ 12/13/2008 1:55:48 AM
RE: Convert Datetime do Timestamp Posted by Peter Wagner @ 12/13/2008 5:25:37 AM