MattWW
(Matt)
1
Hi,
I’m passing a date in as a string “130319”, but I need to convert it to a datetime object, because I want to compare it to the current system date.
How can I convert this string into a datetime ?
I’ve tried DateTime.Parse and DateTime.ParseExact, both didn’t work.
Thanks
ddrdushy1
(Dushyanth)
2
hi @MattWW,
create a variable with “Date” data type.
assign the value like this,
dateVariable = Date.parseExact("130319","ddMMyy",Nothing)
thanks
1 Like
MattWW
(Matt)
3
All good…
I just tried,
DateTime.ParseExact(“130319”, “ddMMyy”, System.Globalization.CultureInfo.InvariantCulture)
And it worked …
2 Likes
VirajN
(Viraj Nalawade)
4
you should mark @ddrdushy1 answer as the solution after all he did give you an idea to explore … just a thought 
system
(system)
Closed
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.