Good afternoon,
I need to retrieve the day of the week (1 through 7) from the current date to use as a file extension. Using the date format of 'F' in a timestamp expression today (Wednesday) is always returning a value of '2' instead of '4'. What am I missing in this? My code is:
<timestamp version="1.0" disabled="false">
<format outputVariable="DW_DAY" pattern="F" />
</timestamp>
TIA,
Kevin
retrieving the day of week number
Post any question you may have in regards to GoAnywhere MFT and let our talented support staff and other users assist you.
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
Re: retrieving the day of week number
Maybe I'm misunderstanding the purpose of this value - I think it is telling me the number of occurrences of the day of the week within that month? So it is telling me that it is the second Wednesday of the month?
If so, is there a function that will tell me what day of the week it is, like '1' is Sunday, '2' is Monday, '5' is Thursday, etc? Or do I need a table that produces that?
Thanks,
Kevin
If so, is there a function that will tell me what day of the week it is, like '1' is Sunday, '2' is Monday, '5' is Thursday, etc? Or do I need a table that produces that?
Thanks,
Kevin
- Support_Rick Offline
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
- Contact:
Re: retrieving the day of week number
Kevin,
The option "E" allows you to get the "Day of the Week" (Sun, Mon, Tue, Wed, etc) which could give you the xref into 1,2,3,4.
Will that work?
The option "E" allows you to get the "Day of the Week" (Sun, Mon, Tue, Wed, etc) which could give you the xref into 1,2,3,4.
Will that work?
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Re: retrieving the day of week number
Thanks Rick, I guess it will have to work. I can make an xref table based on the day name to get the number. The user may want to have Monday = Day 1, so an xref would work better anyway in that situation.
- Support_Rick Offline
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
- Contact:
Re: retrieving the day of week number
Try using a "u" instead... looks like there might be a Java Bug.
${CurrentDate('u')}
That should give you what you're looking for
${CurrentDate('u')}
That should give you what you're looking for
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Re: retrieving the day of week number
Hi Rick,
this subtracted a day from the current date? maybe I'm not using it right... I think the xref will give me what I (and the user) need.
xml code =
<timestamp version="1.0">
<format outputVariable="DU_DAY" dayOfWeek="${CurrentDate('u')}" />
</timestamp>
Result = Timestamp variable 'DU_DAY' was created and set to '2017-03-08 14:44:29.743'
this subtracted a day from the current date? maybe I'm not using it right... I think the xref will give me what I (and the user) need.
xml code =
<timestamp version="1.0">
<format outputVariable="DU_DAY" dayOfWeek="${CurrentDate('u')}" />
</timestamp>
Result = Timestamp variable 'DU_DAY' was created and set to '2017-03-08 14:44:29.743'
- Support_Rick Offline
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
- Contact:
Re: retrieving the day of week number
No, you don't need the "TimeStamp" task with that. Just use the function where you need it...
Like:
SetVariable DU_Day : Value="${CurrentDate('u')}"
Like:
SetVariable DU_Day : Value="${CurrentDate('u')}"
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696