Hi, I am reading date from string variable the format is dd/MM/yyyy
like 15/06/2020
But when I convert into DateTime format I am getting 15/06/2020 00:00:00
How can we trim the timestamp?
@Palaniyappan @Lahiru.Fernando
Hi, I am reading date from string variable the format is dd/MM/yyyy
like 15/06/2020
But when I convert into DateTime format I am getting 15/06/2020 00:00:00
How can we trim the timestamp?
@Palaniyappan @Lahiru.Fernando
DateTime.ParseExact(FromDate,“dd/MM/yyyy”, CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)
Hi @balkishan
If the timestamp is always like 00:00:00
Then you can simply replace the string by .replace(“00:00:00”,“”)
this is not the right way bro.
My variable is DateTime only
you can’t use .Replace behind the DateTime var
Not this way bro.
I have converted my var from string to DateTime again you want me to convert into string.
Have you try this
**DatetimeVariable.Date**
No, same get the timestamp.
DatetimeVariable.ToShortDateString
its working
There is no such thing, a DataTime type will always have a “time” part in it, you need to just ignore it…
Hey @balkishan
if you are using a dateTime variable, the time part will always be there bro… You cannot remove that from a datetime variable. if you want to remove that, then you have to convert it to a string and format the date.
You can just ignore the time part as it just have the default 00:00:00 value… If you really want to remove it, there is no other option other than converting it to a string and formatting it…
This can be obtained
With this expression
Dat_value = DateTime.Date
Where Dat_value is a variable of type System.DateTime
Which would give us only the date value without timestamp
Cheers @balkishan
no, this will be the same, time will be 00:00 anyway…
see I don’t want again convert DateTime into String…