myString = Date.Now.ToString("tt")
...if you're in US or other country that has such designators (which OP most likely is), or explicitly formatting for such culture. Depending on the culture you get nothing or "AM" or "A/M" or other equivalent strings in return. Using the mathematical calculation on hour component is best if app is to be used by different cultures. For example comparing this formatted output to current cultures PM/AM-designators won't work when they both are empty strings.If you want a string to represent whether it's AM or PM then you do this:VB.NET:myString = Date.Now.ToString("tt")