user1590386
user1590386

Reputation: 77

Pulling time ONLY from date/time value LotusScript Lotus Notes

I am trying to pull the time ONLY in 12 hour format from a LotusScript value.

For example, if the value is [3:00:00 PM] I want to return "3:00" and that's it.

Problems have been that I am getting "15" as hour. I get "0" as minute. Some of the things I tried return errors.

Thanks in advance

Upvotes: 2

Views: 2659

Answers (1)

Dmytro Pastovenskyi
Dmytro Pastovenskyi

Reputation: 5419

I'd recommend to use format function

here is an example:

Dim s As New notessession
Dim dt As New NotesDateTime(now)
Print strleft(Format(dt.Timeonly, "h:nn AM/PM"), " ")

Upvotes: 4

Related Questions