Knock yourself out, my personal notes on dates over the years
Can I suggest you install ObjectBrowser and just mess about with anything with the word Date you find in F9862:
Date Manipulation BSFN within JDE
First day of the month
VA evt_StringFirstDayMonth = concat("01",substr(date_today(),2,8))
Convert String to a date (N0800640)
· Get week of the year
N0501033 DeriveWeeksMonthsYearsFrom2Dates
Set From date to 01/01/XX
To date = today
Eg 20/09/2013 = 37.42th week of the year
· Get Week of Month
B0130151 GetWeekOfMonth
Use a date to yield both month of year and week of that month
· BSFN – Convert String to Date DDMMYY - B76A8015
DL01 Þ szStringtoConvert
DRQJ Ü mnDay
BSFN – Convert Date to String – B9800460
DRQJ Þ jdDatetoConvert
DL01 Ü sxDateConvertedtoString
BSFN - User Date, Format - B0000078
This BSFN can perform in 2 modes.
(2) Û mnMonth DMTM
(2) Û mnDay DMTD
(2) Û mnYear DMTY
(2) Û mnCentury DMT#
(6) Û jdReturnDate DATE01
‘ ‘ / ‘1’ Þ cProcessingFlag
Pass a blank ‘ ‘ to bring back the date from the bits.
Pass a ‘1’ to bring back the bits from the passed in date.
01-Mar-08 Format Dates
User Date, Format
VA rpt_BirthdateMonth <- mnMonth
VA rpt_BirthdateDay <- mnDay
VA rpt_BirthdateYear <- mnYear
UNDEFINED X mnCentury
BC Date - Invoice - Julian -> jdReturnDate
"1" -> cProcessingFlag
Date Format Month Description
VA rpt_BirthdateMonth -> mnCalendarMonth
VA rpt_MonthDescriptionDESC <- szDescription
RV InvoiceDateDL01 = concat([VA rpt_BirthdateDay],concat('-',concat([VA rpt_MonthDescriptionDESC],concat('-',[VA rpt_BirthdateYear] )) ))
BSFN – Format Date from Day Month Year - B41B0470
This BSFN only brings BACK a 6 digit date from the D M Y components.
(2) Þ mnYear
(2) Þ mnMonth
(2) Þ mnDay
(6) Ü jdDate
BSFN – Separate Year and Century from 4 byte ye - N0700400
(6) Þ jdDate
(2) Ü mnCentury
(2)? Ü mnYear
BSFN - Retrieve Correct Century - B0000154
Based on a cut off year, CENTCHG, say 50
FY Þ mnFiscalYear
(2) Ü mnCentury
(4) Ü mnCenturyYear
BSFN - F0008 Get Fiscal Date Pattern - B0000167
Use this BSFN to bring back period start dates and the actual Tax year etc.
T / R Þ cFiscalDatePattern
G/L Þ jdDateforG/L
(2) Ü mnCentury
(2) Ü mnYear
(2) Ü mnPeriodNo
……loads of other stuff (Period start dates etc)
where you encounter dates in substr commands please perform the following
VA evt_VC10A_StringDate6 = substr([VAvt_SGLMSGDATA_MessageData],201,6)
Call ConvertStringToDate_DDMMYY - B76A8015
Value
Dir
Parameter
VA evt_VC10A_StringDate6
>
szStringtoConvert
VA evt_MMEJ_jdExpirationDate
<
jdDatecoverted
BSFN - User Date, Format - B0000078
This BSFN can perform in 2 modes.
(2) Û mnMonth
(2) Û mnDay
(2) Û mnYear
(2) Û mnCentury
(6) Û jdReturnDate
‘ ‘ / ‘1’ Þ cProcessingFlag
Pass a blank ‘ ‘ to bring back the date from the bits.
Pass a ‘1’ to bring back the bits from the passed in date.
BSFN – Format Date from Day Month Year - B41B0470
This BSFN only brings BACK a 6 digit date from the D M Y components.
(2) Þ mnYear
(2) Þ mnMonth
(2) Þ mnDay
(6) Ü jdDate
BSFN – Separate Year and Century from 4 byte ye - N0700400
(6) Þ jdDate
(2) Ü mnCentury
(2)? Ü mnYear
BSFN - Retrieve Correct Century - B0000154
Based on a cut off year, CENTCHG, say 50
FY Þ mnFiscalYear
(2) Ü mnCentury
(4) Ü mnCenturyYear
BSFN - F0008 Get Fiscal Date Pattern - B0000167
Use this BSFN to bring back period start dates and the actual Tax year etc.
T / R Þ cFiscalDatePattern
G/L Þ jdDateforG/L
(2) Ü mnCentury
(2) Ü mnYear
(2) Ü mnPeriodNo
……loads of other stuff (Period start dates etc)
· F0008 Get fiscal Period Number – X0903
Use this BSFN to bring FY info for a CO based on todays date in Julian
CO Þ szCompany
G/L Þ jdDateforG/L
(2) Ü mnPeriodNo
(2) Ü mnYear
(2) Ü mnCentury
where you encounter dates in substr commands please perform the following
VA evt_VC10A_StringDate6 = substr([VAvt_SGLMSGDATA_MessageData],201,6)
Call ConvertStringToDate_DDMMYY - B76A8015
Value
Dir
Parameter
VA evt_VC10A_StringDate6
>
szStringtoConvert
VA evt_MMEJ_jdExpirationDate
<
jdDatecoverted
· BSFN - Convert String Date to Format – B0800208
Date back Ü jdConvertedDateJulian
StringDate VC10A Þ szStringtoConvert
Mask Þ szFormatMask
Masks Available (stored in UDC 00 DF)
Mask
Description
D
Day Number, 1 or 2 digits.
A
Day Number, ZERO pad to 2 digits.
Y
Day Number, space pad to 2 digits.
M
Month Number, 1 or 2 digits
O
Month Number, ZERO pad to 2 digits.
N
Month Number, space pad to 2 digits.
T
Month Number, by language, from UDC
B
Abbreviated Month Name, by language, from UDC.
R
2 Digit Year.
E
4 Digit Year
S
Date slash character, from configuration
C
Date comma character, from configuration.