nick.v
(nic)
May 4, 2020, 9:56am
1
Hi,
I only need part of the variable that i am storing, e.g. when using type into i only need the the date and not the date and time
storing the values is not a problem but when typing it into a spreadsheet its writing the whole variable.
can somebody help me?
hi @nick.v ,
Lets Say strDateVariable has Value β05/04/2020 15:32:02β
Below Expression will return : β05/04/2020β
Convert.ToDateTime(strDateVariable).ToShortDateString
β
Mukesh
2 Likes
@nick.v Another Solution would be to use Split method :
Split(strDateVariable)(0).ToString
2 Likes
nick.v
(nic)
May 4, 2020, 10:03am
4
@mukeshkala Hi, it wonβt be todays date all the time, its the date on the webpage i need to enter into a spreadsheet. Where the date is taken the time is taken aswell so i just want to removed the time from the variable
nick.v
(nic)
May 4, 2020, 10:07am
5
@supermanPunch @mukeshkala dont worry guys ive fixed it using this SubString(0,1) after the variable
2 Likes
Please use the below - Here we are teling to split by space and get the Value at the 0 index ie Date
strDateVariable.Split(" "c)(0).ToString
β
Mukesh
2 Likes