Date in the format of the W3C

34 views
Skip to first unread message

Cleber

unread,
May 9, 2012, 2:59:40 PM5/9/12
to OpenQM
Date in format yyyy-mm-dd

http://www.w3.org/TR/NOTE-datetime

:who
2 GB
:ED MD LOGIN
MD LOGIN
10 line(s)
----:
0001: PA
----: P
0001: PA
0002: TERM
0003: PTERM CASE NOINVERT
0004: DATE.FORMAT ON <=============
0005: OPTION QUERY.NO.CASE
0006: AUTOLOGOUT 120
0007: NLS CURRENCY R$
0008: NLS THOUSANDS .
0009: NLS DECIMAL ,
0010: NLS IMPLICIT.DECIMAL ,
Bottom at line 10
----: EX

:ED BP TEST
BP TEST
14 line(s)
----: P
0001: PRINT OCONV(DATE(),'D4/')
0002: PRINT OCONV(DATE(),'D YMD-')
0003: PRINT OCONV(DATE(),'D YMD') <=================
0004: DATA$ = OCONV(DATE(),'D YMD') <=================
0005: DATA$ = DATA$[1,4]:'-':DATA$[6,2]:'-':DATA$[9,2]
<============== *
0006: PRINT DATA$
0007: PRINT OCONV(DATE(),'DX-')
0008: PRINT OCONV(DATE(),'DX')
0009: EXECUTE 'DATE.FORMAT OFF'
0010: PRINT OCONV(DATE(),'D4/')
0011: EXECUTE 'DATE.FORMAT ON'
0012: PRINT OCONV(DATE(),'D4/')
0013: STOP
0014: END
Bottom at line 14
----:


:RUN BP TEST
09/05/2012
16201
2012 05 09 <================
2012-05-09 <================ *
16201
20120509
05/09/2012
09/05/2012

* There is a simpler way, using only oconv?


Cleber

Cleber Vieira Baptista

unread,
May 9, 2012, 3:03:13 PM5/9/12
to OpenQM


2012/5/9 Cleber <multis...@gmail.com>
Date in format yyyy-mm-dd

http://www.w3.org/TR/NOTE-datetime

:who
2 GB
:ED MD LOGIN
MD LOGIN
10 line(s)
----:
0001: PA
----: P
0001: PA
0002: TERM
0003: PTERM CASE NOINVERT
0004: DATE.FORMAT ON  <=====
0005: OPTION QUERY.NO.CASE
0006: AUTOLOGOUT 120
0007: NLS CURRENCY R$
0008: NLS THOUSANDS .
0009: NLS DECIMAL ,
0010: NLS IMPLICIT.DECIMAL ,
Bottom at line 10
----: EX

:ED BP TEST
BP TEST
14 line(s)
----: P
0001: PRINT OCONV(DATE(),'D4/')
0002: PRINT OCONV(DATE(),'D YMD-')
0003: PRINT OCONV(DATE(),'D YMD')  <====
0004: DATA$ =  OCONV(DATE(),'D YMD') <====
0005: DATA$ = DATA$[1,4]:'-':DATA$[6,2]:'-':DATA$[9,2] <== *

0006: PRINT DATA$
0007: PRINT OCONV(DATE(),'DX-')
0008: PRINT OCONV(DATE(),'DX')
0009: EXECUTE 'DATE.FORMAT OFF'
0010: PRINT OCONV(DATE(),'D4/')
0011: EXECUTE 'DATE.FORMAT ON'
0012: PRINT OCONV(DATE(),'D4/')
0013: STOP
0014: END
Bottom at line 14
----:


:RUN BP TEST
09/05/2012
16201
2012 05 09 <==
2012-05-09 <== *

16201
20120509
05/09/2012
09/05/2012

 * There is a simpler way, using only oconv?


Cleber

--
You received this message because you are subscribed to the Google Groups "OpenQM" group.
To post to this group, send an email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openqm+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openqm?hl=en-GB.




--
Cleber

+55 61 9246-9500

CDMI - Steve T

unread,
May 9, 2012, 3:26:06 PM5/9/12
to ope...@googlegroups.com
try PRINT OCONV(DATE(),'D-YMD')
 
Steve Trimble
Computerized Data Mgmt Inc
PO Box 13403
Maumelle, AR 72113
(501) 803-0974 09:00am - 6:00pm CST



From: Cleber <multis...@gmail.com>
To: OpenQM <ope...@googlegroups.com>
Sent: Wed, May 9, 2012 12:59:44 PM
Subject: Date in the format of the W3C
--
You received this message because you are subscribed to the Google Groups "OpenQM" group.
To post to this group, send an email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openqm+unsub...@googlegroups.com.

Cleber Vieira Baptista

unread,
May 9, 2012, 3:30:10 PM5/9/12
to ope...@googlegroups.com
2012 05 09

Missing hyphen

Cleber

2012/5/9 CDMI - Steve T <cd...@swbell.net>

Ashley Chapman

unread,
May 9, 2012, 3:38:12 PM5/9/12
to ope...@googlegroups.com
Works correctly for me.  What version of QM and platform is this on?

--
You received this message because you are subscribed to the Google Groups "OpenQM" group.
To post to this group, send an email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openqm+un...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/openqm?hl=en-GB.



--
Ashley Chapman

Cleber Vieira Baptista

unread,
May 9, 2012, 3:40:10 PM5/9/12
to ope...@googlegroups.com


http://www.w3.org/TR/NOTE-datetime

...

"Formats

Different standards may need different levels of granularity in the date and time, so this profile defines six levels. Standards that reference this profile should specify one or more of these granularities. If a given standard allows more than one granularity, it should specify the meaning of the dates and times with reduced precision, for example, the result of comparing two dates with different precisions.

The formats are as follows. Exactly the components shown here must be present, with exactly this punctuation. Note that the "T" appears literally in the string, to indicate the beginning of the time element, as specified in ISO 8601.

   Year:
      YYYY (eg 1997)
   Year and month:
      YYYY-MM (eg 1997-07)
   Complete date:
      YYYY-MM-DD (eg 1997-07-16)
   Complete date plus hours and minutes:
      YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00)
   Complete date plus hours, minutes and seconds:
      YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00)
   Complete date plus hours, minutes, seconds and a decimal fraction of a
second
      YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)"




2012/5/9 Cleber Vieira Baptista <multis...@gmail.com>

Cleber Vieira Baptista

unread,
May 9, 2012, 3:41:50 PM5/9/12
to ope...@googlegroups.com


2012/5/9 Ashley Chapman <ashley....@billabong-services.co.uk>

Works correctly for me.  What version of QM and platform is this on?


Linux

Escape character is '^]'.
[ QM Rev 2.12-4   Copyright Ladybridge Systems, 2011 ]
Username:



Ashley Chapman

unread,
May 9, 2012, 3:48:39 PM5/9/12
to ope...@googlegroups.com
Okay Cleber, something weird is going on with your system I think.

:CT BP TESTDATE
BP TESTDATE
1: PRINT OCONV(DATE(),'D-YMD')
2: END
:RUN BP TESTDATE
2012-05-09

This is on Linux QM (GPL) version 2.6-6


Ashley


Cleber Vieira Baptista

unread,
May 9, 2012, 3:53:46 PM5/9/12
to ope...@googlegroups.com
In the manual online QM:

'D YMD'           1994 06 01

I will use:

04: DATA$ =  OCONV(DATE(),'D YMD')

05: DATA$ = DATA$[1,4]:'-':DATA$[6,2]:'-':DATA$[9,2]


Thank you

Cleber




2012/5/9 Ashley Chapman <ashley....@billabong-services.co.uk>

--
You received this message because you are subscribed to the Google Groups "OpenQM" group.
To post to this group, send an email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openqm+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openqm?hl=en-GB.



--
Cleber

+55 61 9246-9500

Kevin Powick

unread,
May 9, 2012, 4:36:26 PM5/9/12
to ope...@googlegroups.com


On Wednesday, 9 May 2012 15:48:39 UTC-4, Ashley Chapman wrote:
Okay Cleber, something weird is going on with your system I think.

:CT BP TESTDATE
BP TESTDATE
1: PRINT OCONV(DATE(),'D-YMD')
2: END
:RUN BP TESTDATE
2012-05-09


Works as expected for me too. 2.12-7 on OSX.

--
Kevin Powick 

Kevin Powick

unread,
May 9, 2012, 4:41:56 PM5/9/12
to ope...@googlegroups.com
Several formats tested, no problem 2.12-7 on OSX

0001: CRT OCONV(DATE(),'D-YMD')
0002: CRT OCONV(DATE(),'D YMD')
0003: CRT OCONV(DATE(),'D/YMD')
0004: END

:run bp xx

2012-05-09
2012 05 09
2012/05/09

--
Kevin Powick

Ashley Chapman

unread,
May 9, 2012, 4:42:07 PM5/9/12
to ope...@googlegroups.com
Ahhhhhh, I see the problem.  You're using 'D YMD-' instead of 'D-YMD'


Cleber Vieira Baptista

unread,
May 9, 2012, 4:46:31 PM5/9/12
to ope...@googlegroups.com


2012/5/9 Ashley Chapman <ashley....@billabong-services.co.uk>

Ahhhhhh, I see the problem.  You're using 'D YMD-' instead of 'D-YMD'

I used the two

:CT BP TEST
BP TEST
01: PRINT OCONV(DATE(),'D4/')
02: PRINT OCONV(DATE(),'D YMD-') <<<<<<
03: PRINT OCONV(DATE(),'D YMD')  <======

04: DATA$ =  OCONV(DATE(),'D YMD')
05: DATA$ = DATA$[1,4]:'-':DATA$[6,2]:'-':DATA$[9,2]
06: PRINT DATA$
07: PRINT OCONV(DATE(),'DX-')
08: PRINT OCONV(DATE(),'DX')
09: EXECUTE 'DATE.FORMAT OFF'
10: PRINT OCONV(DATE(),'D4/')
11: EXECUTE 'DATE.FORMAT ON'
12: PRINT OCONV(DATE(),'D4/')
13: STOP
14: END



:RUN BP TEST
09/05/2012
16201 <<<<<<<
2012 05 09 <======

2012-05-09
16201
20120509
05/09/2012
09/05/2012

CDMI - Steve T

unread,
May 9, 2012, 4:54:38 PM5/9/12
to ope...@googlegroups.com
Cleber - on line 2, your dash is in the WRONG PLACE
it should be
'D-YMD'
  NOT
'D YMD-'
 
Steve Trimble
Computerized Data Mgmt Inc
PO Box 13403
Maumelle, AR 72113
(501) 803-0974 09:00am - 6:00pm CST



From: Cleber Vieira Baptista <multis...@gmail.com>
To: ope...@googlegroups.com
Sent: Wed, May 9, 2012 2:46:36 PM
Subject: Re: Date in the format of the W3C

Cleber Vieira Baptista

unread,
May 9, 2012, 5:30:52 PM5/9/12
to ope...@googlegroups.com
----: I
0001= PRINT OCONV(DATE(),'D-YMD')
0002= STOP
0003= END
0004=
Bottom at line 3
----: FI
'TEST' filed in BP
:BASIC BP TEST
Compiling BP TEST
0 error(s)
Compiled 1 program(s) with no errors
:RUN BP TEST
2012-05-09


OK :)
Cleber

2012/5/9 CDMI - Steve T <cd...@swbell.net>
Cleber - on line 2, your dash is in the WRONG PLACE
Reply all
Reply to author
Forward
0 new messages