Custom format using time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using Office 2003 and Windows XP;

I would like to return the time in a variable in AM/PM format, but without
the AM/PM in the string.

Ideally, for example if it is now 4:42 PM (or AM - this does not matter) my
function would return: 0442

Can someone help me out with this?

Thanks.
 
XP said:
Using Office 2003 and Windows XP;

I would like to return the time in a variable in AM/PM format, but
without the AM/PM in the string.

Ideally, for example if it is now 4:42 PM (or AM - this does not
matter) my function would return: 0442

Can someone help me out with this?

Thanks.

Left(Format(Now(), "hhnn ampm"), 4)

You need the ampm even though you end up clipping it off to avoid military
hours.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top