Forum Discussion
"1a" text can be convert in integer
- 6 years ago
You can use VALUE to convert a string to a datetime.
Writing 0a is interpreted as 0am, 1a is like 1am, and so on (I just discovered it - I didn't know that you can shorten am/pm into a/p).
You can also write 1p, which is like 1pm.
In a datetime the hour is a fraction of a day, so 1am is 1/24. If you write 0a and 12a you get always 0, but if you write 13a is like 1p, which is 13/24.
I hope it helps!
Marco
You can use VALUE to convert a string to a datetime.
Writing 0a is interpreted as 0am, 1a is like 1am, and so on (I just discovered it - I didn't know that you can shorten am/pm into a/p).
You can also write 1p, which is like 1pm.
In a datetime the hour is a fraction of a day, so 1am is 1/24. If you write 0a and 12a you get always 0, but if you write 13a is like 1p, which is 13/24.
I hope it helps!
Marco