DateTime date_1 = 01/30/2024 00:00:00
Desired output str_1 = Jan 30, 2024 (string variable)
Please advise
DateTime date_1 = 01/30/2024 00:00:00
Desired output str_1 = Jan 30, 2024 (string variable)
Please advise
Hey @shrishti.diggikar
you can use ToString method:
yourDateTimeVariable.ToString(“MMM dd, yyyy”)
- Assign -> str_1 = date_1.ToString("MMM dd, yyyy")
Check the below workflow for better understanding,
Hope it helps!!
Here are all the options you can use for .ToString on a datetime. Scroll down to the format specifier table.
I’m getting this error. Can you please advise what could be the reason?
please use the immediate panel
type in the following statements:
startDate
startDate.GetType()
and share a screenshot of the outcomes with us. Thanks
can you use the immediate panel (highly recommended to work with and really usefull for quick rnd and prototyping)
startDate.ToString("MMM dd, yyyy")
From our end a screenshot
Thanks @ppr for detailed explanation!
try
CDate(CurrentRow("Start Date").toString().Trim).ToString("MMM dd, yyyy")
This worked for me!
DirectCast(CurrentRow(“Start Date”), DateTime).ToString(“MMM d, yyyy”)
its just a variation of the conversion
just for the info:
CurrentRow is of DataType: DataRow
The Column Values are within the ItemArray which is an Object Array
So we have several methods to get proper returned datetime which we can format later:
or we are going further to approaches like
Thanks for pointing that out! Super helpful in future projects!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.