Hey. one important question please....

Hey. one important question please....

Post by forinfinit » Mon, 27 Mar 2006 12:40:26


If I SET EPOCH TO 1970, will that mean that every date entered as say,
01/01/06 will always be (internally that is) 01/01/2006, and not 1906? Is
that all it takes to force the date?

If so, I would not have to rewrite my code for set century. I can't afford
the time right now to reformat all my spacing to allow for the two extra
date digits.

Thanks..
 
 
 

Hey. one important question please....

Post by Stephen Qu » Mon, 27 Mar 2006 13:01:28

> If I SET EPOCH TO 1970, will that mean that every date entered as say,

Yes
EPOCH 1970 = 100 years - 1970-2069
So any dates entered in the short format will default to that 100 year range.

You don't have worry about the spacing problem if you don't
SET CENTURY ON
as CTOD() and CTOD() always respect that setting unless specified in a picture
clause
ie
// You'll see the century digits
@ 5,5 SAY 'Date ' + DTOC( xyz->DATEFIELD ) PICTURE '99/99/9999'

It's data entry you need to look at and setting the EPOCH fixes that (in most
cases)
One exception would be DOB entry - might require 4 digit entry

HTH
Steve

 
 
 

Hey. one important question please....

Post by Stephen Qu » Mon, 27 Mar 2006 13:55:59


Scratch that - it's AA

ie
SET CENTURY OFF
This part's right<g>

I had a requirement in an app to only show '99/99/99' in a TBrowse but I was
using SET CENTURY ON so I wrote a function that returns the 8 character string
while leaving the global settings as they were.

HTH
Steve