Convert timestamp to MMDDCCYYHHMMSS
Moderators: chulett, rschirm, roy
Convert timestamp to MMDDCCYYHHMMSS
Hi, thanks for reading. How can I convert a timestamp to MMDDCCYYHHMMSS? Thanks!!
-
- Premium Member
- Posts: 12
- Joined: Mon Oct 22, 2007 7:58 am
Re: Convert timestamp to MMDDCCYYHHMMSS
please read pallelextender pdf document.
-
- Premium Member
- Posts: 12
- Joined: Mon Oct 22, 2007 7:58 am
Re: Convert timestamp to MMDDCCYYHHMMSS
please read pallelextender pdf document.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If you already have a timestamp, which I infer from your original post in this thread, simply convert it to a string, then use substring and concatenation to build the new format. Converting all the internal delimiters to "" first will make this easier.
Assign stage variable svTS with
Build your output column as
Assign stage variable svTS with
Code: Select all
Convert(" ;-", "", TimestampToString(InLink.TheTimestamp))
Code: Select all
svTS[5,2]:svTS[7,2]:svTS[1,4]:svTS[9,6]
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If you already have a timestamp, which I infer from your original post in this thread, simply convert it to a string, then use substring and concatenation to build the new format. Converting all the internal delimiters to "" first will make this easier.
Assign stage variable svTS with
Build your output column as
Assign stage variable svTS with
Code: Select all
Convert(" ;-", "", TimestampToString(InLink.TheTimestamp))
Code: Select all
svTS[5,2]:svTS[7,2]:svTS[1,4]:svTS[9,6]
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Or, just change the timestamp mask to whatever you want in the output stage by going to the extended properties. The date is stored internally. It could be displayed however you want, which is determined by the mask that is supplied at the project level, set in the administrator. To override that, change it in the extended properties of your column in your target stage.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.