DateTime Formula

Jason Russell
Jason Russell used Ask the Experts™
on
I am presently trying to create a datetime formula that will populate at the time when the report is printed. The format for this will be 2109201502:15PM . So basically DDMMYYYYHH:MMTT. I have been beating my head off a wall because if I get the date and time combined I can't get it to leave the space out after the minutes where its formating it as DDMMYYYYHH:MM TT. Anything I bring into the formula wants to add a space where I don't want the space.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

Commented:
maybe

DDMMYYYYhh:mmTT

or maybe use two functions and concatenate them
one with
DDMMYYYY
the other with
hh:mmTT

Regards
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
Try it this way

CStr(CurrentDateTime,"ddMMyyyyHH:MMtt")

mlmcc
Top Expert 2004

Commented:
Certain letters in the format string are case sensitive.  Capital M's are for months and lowercase m's are for minutes.  Capital H's mean 24 hour clock while lower case h's mean 12 hour clock.  You will need a mlmcc's formula with some minor changes:

CStr(CurrentDateTime,"ddMMyyyyhh:mmtt")

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial