Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Dan Baker
  Where is Dan Baker?
 Effort of the Poconos
 Pennsylvania - United States
 Dan Baker
 To: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Canada
 Pete Sass
 Tags
Subject: RE: How does SCX TimeStamp get computed?
Thread ID: 416100 Message ID: 416115 # Views: 38 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Sunday, December 21, 2014 11:41:09 PM         
   


Pete,

Thanks for this. I was completely unaware that you could SQL the project file in this
way! That's great.

Now I am also interested in finding the timestamp of individual controls within each
form. And it looks like what Greg supplied can help me there.

Dan B.


> Hi Dan,
>
> Never tackled things down to the granular level, but my first kick at the cat would
> be to open the ProjectName.pjx and obtain the timestamp values against whatever you would
> want to check date and times against.
>
> You could of course obtain the information out of the PRJ file via a SQL Select statement.
> SELECT * FROM TextSearch.pjx INTO CURSOR curProjName && Where TextSearch is the project name.
> SELECT curProjName
> Browse
>
> OK now you need to enumerate the timestamp field data in the project in order to compare the datetime
> stamp against maybe your last backup date, so anything newer would be tagged for backup.
>
> The following function will take the project's timestamp numeric value and convert it into a readable
> datetime stamp value you can use - lol
> The conversion converts into the DD/MM/YY format with a military time on the end.
>
> ps.. at this point I do not recall where this code came from. I know a few years back I made some
> changes to it as if all follows my coding styles, but I do not thing I wrote the original version and
> cannot give credit the person who original coded this.
>
>
* --- TsToDate.prg
> * --- CALLING SYNTAX:  <variable> = TSToDate(<nTimeStamp>,<cStyle>)
> * --- EXAMPLE       :  cDateTime  = TsToDate(TimeStamp,"DATETIME")
> 
> *************************************************
> PARAMETER nTimeStamp, cStyle
> PRIVATE cRetVal   
> 
> * --- Timestamp check.
> IF TYPE('nTimeStamp') != "N"
>   WAIT WINDOW "Time stamp you passed to me is not numeric."
>   RETURN ""
> ENDIF  
> 
> IF nTimeStamp = 0
>   RETURN "No TimeStamp?"
> ENDIF
> 
> * --- Default return style to both date and time.
> IF TYPE('cStyle') != "C"
>   cStyle = "DATETIME"
> ENDIF
> 
> IF !INLIST(UPPER(cStyle),"DATE","TIME","DATETIME")
>   WAIT WINDOW "Style must be passed as" + "DATE, TIME, or DATETIME"
> ENDIF
> 
> nYear   = ((nTimeStamp/(2**25) + 1980))
> nMonth  = ((nYear-INT(nYear)    )*(2**25))/ (2**21)
> nDay    = ((nMonth-INT(nMonth)  )*(2**21))/ (2**16)
> nHour   = ((nDay-INT(nDay)      )*(2**16))/ (2**11)
> nMinute = ((nHour-INT(nHour)    )*(2**11))/ (2**05)
> nSecond = ((nMinute-INT(nMinute))*(2**05))* 2
> 
> cRetVal = ""
> 
> IF "DATE" $ UPPER(cStyle)  
>   cRetVal = cRetVal + RIGHT("0"+ALLTRIM(STR(INT(nMonth))),2) + "/" + RIGHT("0"+ALLTRIM(STR(INT(nDay))),2) + "/" + RIGHT("0"+ALLTRIM(STR(INT(nYear))),2)
> ENDIF
> 
> IF "TIME" $ UPPER(cStyle)
>   cRetVal = cRetVal + IIF("DATE" $ UPPER(cStyle), " ", "")
>   cRetVal = cRetVal + RIGHT("0"+ALLTRIM(STR(INT(nHour))),2) + ":" + RIGHT("0"+ALLTRIM(STR(INT(nMinute))),2) + ":" + RIGHT("0"+ALLTRIM(STR(INT(nSecond))),2)
> ENDIF
> RETURN cRetVal

>
>
>
> Pete "the IceMan", from the Great White North of Canada.
> www.marathongriffincomputers.com

ENTIRE THREAD

How does SCX TimeStamp get computed? Posted by Dan Baker @ 12/21/2014 4:37:08 PM
RE: How does SCX TimeStamp get computed? Posted by Pete Sass @ 12/21/2014 6:59:56 PM
RE: How does SCX TimeStamp get computed? Posted by Dan Baker @ 12/21/2014 11:41:09 PM
RE: How does SCX TimeStamp get computed? Posted by Pete Sass @ 12/22/2014 12:09:50 AM
RE: How does SCX TimeStamp get computed? Posted by Fernando Bozzo @ 12/21/2014 9:08:48 PM
RE: How does SCX TimeStamp get computed? Posted by Dan Baker @ 12/22/2014 12:45:44 AM
RE: How does SCX TimeStamp get computed? Posted by Greg Green @ 12/21/2014 9:19:59 PM
RE: How does SCX TimeStamp get computed? Posted by Dan Baker @ 12/22/2014 12:52:17 AM
RE: How does SCX TimeStamp get computed? Posted by Greg Green @ 12/22/2014 7:44:39 AM
RE: How does SCX TimeStamp get computed? Posted by Dan Baker @ 12/23/2014 12:11:44 AM
RE: How does SCX TimeStamp get computed? Posted by Jun Tangunan @ 12/22/2014 12:54:11 AM
RE: How does SCX TimeStamp get computed? Posted by Mustapha Bihmouten @ 12/22/2014 2:59:24 PM
RE: How does SCX TimeStamp get computed? Posted by Dan Baker @ 12/22/2014 3:10:42 PM