How can I store both of date and time to one long variable?

TheJoe

New Member
Licensed User
Longtime User
I tried to convert both of date and time to one long variable as belows:

Dim L, L1, LR As Long
L = DateTime.DateParse("04/26/1972")
L1 = DateTime.TimeParse("09:15:00")
LR = L + L1
Msgbox("Day=" & DateTime.GetDayOfMonth(LR) & ", Month=" & DateTime.GetMonth(LR) & ", Year=" & DateTime.GetYear(LR),"Hour=" & DateTime.GetHour(LR) & ", Minute=" & DateTime.GetMinute(LR))

I found that the result is not same.

Anyone know how to store both of date and time to one variable ?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…