There is a way to store the values before and after 12:00 in Now, but is there a function to directly determine if it is AM or PM?
Hi,
Can you try the following condition?
Now.Hour<12
True : AM
False : PM
Regards,
Please make use of the below code as in the inline screenshots.
Datetime.Now.ToString(“tt”) - this will simply return the value whether AM or PM.

Hope this will help you. Thank you.
5 Likes
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.