Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Informational : Format Date Specs

 
   Database Forums (Home) -> Paradox RSS
Next:  Update failed  
Author Message
Robert Wiltshire

External


Since: Sep 30, 2005
Posts: 18



(Msg. 1) Posted: Thu Feb 14, 2008 3:03 pm
Post subject: Informational : Format Date Specs
Archived from groups: comp>databases>paradox (more info?)

Some things in pdox get done so often it becomes second nature.
Other times, one sits and thinks, how the heck did I do that last time ?
Then, you must search for an example, or just figure it out again.

I am not sure how many times I have had to go into the help screen
and lookup the format specs.

After way too many trips to the help screen for the format command,
I finally got around to making a quick cheat sheet for myself.
and figured I would post it here as a community reference table.

Obviously there are many different ways to do this,
and I did not include all - but it is a starting point.

Lets take todays date , 2/14/2008,
and using the format command,
we can format that many, many different ways.

I will show two examples :
YYYYMMDD or YYYYMM

var
daVal date
stVal string
endvar

daVal = date("2/14/2008")

; to get YYYYMMDD or 20080214
stVal = format("DY3M2D2O(%Y%M%D)",daVal)
stVal.view("YYYYMMDD")

or

; to get YYYYMM or 20080214
stVal = format("DY3M2O(%Y%M)",daVal)
stVal.view("YYYYMM")

So that spells out two examples,
and the others are posted below.

Perhaps next time someone tries to remember one of these,
they can just google this page and cut and paste from here.

If there are any settings for windows or international
that affect these, I am not aware of them at this time,
and so I am not aware if/when your mileage may vary.


Robert Wiltshire



For the date of : 2/14/2008
daVal = date("2/14/2008")
stVal = format("DM1",daVal)

Spec Shorthand FormattedString
------ ----------- -----------------
DM1 m/dd/yy 2/14/08
DM2 mm/dd/yy 02/14/08
DM3 Mon/dd/yy Feb/14/08
DM4 Month/dd/yy February/14/08
DD1 mm/d/yy 02/14/08
DD2 mm/dd/yy 02/14/08
DY1 mm/dd/y 02/14/8
DY2 mm/dd/yy 02/14/08
DY3 mm/dd/yyyy 02/14/2008
D1 mm/dd/yy 02/14/08
D2 Monthname dd, yyyy February 14,2008
D3 mm/dd 02/14
D4 mm/yy 02/08
D5 dd-Mon-yy 14-Feb-08
D6 Mon yy Feb 08
D7 dd-Mon-yy 14-Feb-2008
D8 mm/dd/yyyy 02/14/2008
D9 dd.mm.yy 14.02.08
D10 dd/mm/yy 14/02/08
D11 yy-mm-dd 08-02-14
DY3M2O(%Y%M) YYYYMM 200802
DY3M2D2O(%Y%M%D) YYYYMMDD 20080214
DY3M2D2O(%Y/%M/%D) YYYY/MM/DD 2008/02/14
DY3M2D2O(%Y-%M-%D) YYYY-MM-DD 2008-02-14
DD2O(%D) DD 14
DM2O(%M) MM 02
DY2O(%Y) YY 08
DY3O(%Y) YYYY 2008

 >> Stay informed about: Informational : Format Date Specs 
Back to top
Login to vote
Régis

External


Since: Mar 06, 2006
Posts: 10



(Msg. 2) Posted: Thu Feb 14, 2008 11:08 pm
Post subject: Re: Informational : Format Date Specs [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Another point is the MODE in the BDE (System-Formats-Date)
You do not always obtain the same results if you use MODE 0, 1 or 2
Régis


"Robert Wiltshire" a écrit dans le message de
47b49e62$1@pnews.thedbcommunity.com...
>
> Some things in pdox get done so often it becomes second nature.
> Other times, one sits and thinks, how the heck did I do that last time ?
> Then, you must search for an example, or just figure it out again.
>
> I am not sure how many times I have had to go into the help screen
> and lookup the format specs.
>
> After way too many trips to the help screen for the format command,
> I finally got around to making a quick cheat sheet for myself.
> and figured I would post it here as a community reference table.
>
> Obviously there are many different ways to do this,
> and I did not include all - but it is a starting point.
>
> Lets take todays date , 2/14/2008,
> and using the format command,
> we can format that many, many different ways.
>
> I will show two examples :
> YYYYMMDD or YYYYMM
>
> var
> daVal date
> stVal string
> endvar
>
> daVal = date("2/14/2008")
>
> ; to get YYYYMMDD or 20080214
> stVal = format("DY3M2D2O(%Y%M%D)",daVal)
> stVal.view("YYYYMMDD")
>
> or
>
> ; to get YYYYMM or 20080214
> stVal = format("DY3M2O(%Y%M)",daVal)
> stVal.view("YYYYMM")
>
> So that spells out two examples,
> and the others are posted below.
>
> Perhaps next time someone tries to remember one of these,
> they can just google this page and cut and paste from here.
>
> If there are any settings for windows or international
> that affect these, I am not aware of them at this time,
> and so I am not aware if/when your mileage may vary.
>
>
> Robert Wiltshire
>
>
>
> For the date of : 2/14/2008
> daVal = date("2/14/2008")
> stVal = format("DM1",daVal)
>
> Spec Shorthand FormattedString
> ------ ----------- -----------------
> DM1 m/dd/yy 2/14/08
> DM2 mm/dd/yy 02/14/08
> DM3 Mon/dd/yy Feb/14/08
> DM4 Month/dd/yy February/14/08
> DD1 mm/d/yy 02/14/08
> DD2 mm/dd/yy 02/14/08
> DY1 mm/dd/y 02/14/8
> DY2 mm/dd/yy 02/14/08
> DY3 mm/dd/yyyy 02/14/2008
> D1 mm/dd/yy 02/14/08
> D2 Monthname dd, yyyy February 14,2008
> D3 mm/dd 02/14
> D4 mm/yy 02/08
> D5 dd-Mon-yy 14-Feb-08
> D6 Mon yy Feb 08
> D7 dd-Mon-yy 14-Feb-2008
> D8 mm/dd/yyyy 02/14/2008
> D9 dd.mm.yy 14.02.08
> D10 dd/mm/yy 14/02/08
> D11 yy-mm-dd 08-02-14
> DY3M2O(%Y%M) YYYYMM 200802
> DY3M2D2O(%Y%M%D) YYYYMMDD 20080214
> DY3M2D2O(%Y/%M/%D) YYYY/MM/DD 2008/02/14
> DY3M2D2O(%Y-%M-%D) YYYY-MM-DD 2008-02-14
> DD2O(%D) DD 14
> DM2O(%M) MM 02
> DY2O(%Y) YY 08
> DY3O(%Y) YYYY 2008
>
>
>
>
>

 >> Stay informed about: Informational : Format Date Specs 
Back to top
Login to vote
Tom Krieg

External


Since: Jan 11, 2008
Posts: 6



(Msg. 3) Posted: Fri Feb 15, 2008 4:23 pm
Post subject: Re: Informational : Format Date Specs [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Don't you mean 14/2/2008? I get an invalid date error when converting
2/14/2008 to a date. <GDRVF>

Robert Wiltshire wrote:
>
> Lets take todays date , 2/14/2008,
 >> Stay informed about: Informational : Format Date Specs 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
.NET File Controlled by an older format - Script Error: Error 15 in the errors table d\ controlled by a .NET file in an older format. Your .NET file is in p:\PDOXNET Ok, so the only way I've found to handle this is to kick everybody off the system and delete any remaining .NET files and le...

Need table repair for 3.5 file format - I'm guessing that 3.5 is DOS. Where can I get a DOS Table Repair utility? In house we have Paradox 5.0 and 9.0. When I run the utility I get: TUGetCRTTblDescCount File or directory does not exist

Date record viewed...? - Howdy, I added a date field (called ViewDate) to a particular table because I want a form that displays that table to behave in the following way: I wanted ViewDate to display today() whenever a record was viewed (whether or not it was modified.) The....

Grouping date fields in aquery - Hi Can anyone suggest how I can group (by month or year) a series of dates in a date field using a query, so that I can then chart some other data. Thanks Ian McKenzie

TREEVIEW EN PARADOX - He desarrollado una aplicación utilizando el TImage List de Microsoft pero en algunos eventos me saca el mensaje GPV. ? que puede ser. La aplicación se encuentra en esta direccion ftp.gestioninformatica.com.co
   Database Forums (Home) -> Paradox All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]