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