Try tmpDate = fcCustomFunctions.FormatDate (tmpDate, 'dd/MM/yyyy HH:MM') Look at VB help for format. The Case of the HH:MM vs hh:mm can be significant. From: ismailc via visualbasic-l mailto:[email protected] Sent: Tuesday, February 23, 2010 2:57 PM To: Purdy, Edgar Subject: visualbasic-l Get Current DateTime in format dd/MM/yyyy hh:mm Posted by ismailc on Feb 23 at 3:00 PM Good day, I need to return the current DateTime in format dd/MM/yyyy HH:MM I currently return the current date: mpDate = Date tmpDate = fcCustomFunctions.FormatDate (tmpDate, 'dd/MM/yyyy') Now i'm trying to add time: to get hh:mm tmp=time?? Watch out especially for MM since that is the month. For the minutes use mm. Use HH if you want 24hr clock (military time), and hh if you want regular time. You'll also need a symbol for am and pm, which I don't remember at the moment.
Jon There are 10 kinds of people in the world: Those who understand binary, And those who don't.Original Message- From: epurdy via visualbasic-l mailto:[email protected] Sent: Tuesday, February 23, 2010 2:05 PM To: Jon Jacobs Subject: RE: visualbasic-l Get Current DateTime in format dd/MM/yyyy hh:mm Posted by epurdy on Feb 23 at 3:05 PM Mark this reply as helpfulMark as helpful Try tmpDate = fcCustomFunctions.FormatDate (tmpDate, 'dd/MM/yyyy HH:MM') Look at VB help for format. The Case of the HH:MM vs hh:mm can be significant.
From: ismailc via visualbasic-l mailto:[email protected] Sent: Tuesday, February 23, 2010 2:57 PM To: Purdy, Edgar Subject: visualbasic-l Get Current DateTime in format dd/MM/yyyy hh:mm Posted by ismailc on Feb 23 at 3:00 PM Good day, I need to return the current DateTime in format dd/MM/yyyy HH:MM I currently return the current date: mpDate = Date tmpDate = fcCustomFunctions.FormatDate (tmpDate, 'dd/MM/yyyy') Now i'm trying to add time: to get hh:mm tmp=time?? 'dd/MM/yyyy hh:nn' From: ismailc via visualbasic-l mailto:[email protected] Sent: Tuesday, February 23, 2010 11:57 AM To: randycaus Subject: visualbasic-l Get Current DateTime in format dd/MM/yyyy hh:mm Image removed by sender. Posted by ismailc on Feb 23 at 3:00 PM Good day, I need to return the current DateTime in format dd/MM/yyyy HH:MM I currently return the current date: mpDate = Date tmpDate = fcCustomFunctions.FormatDate (tmpDate, 'dd/MM/yyyy') Now i'm trying to add time: to get hh:mm tmp=time?? Since m is for month you use n for minutes. From: epurdy via visualbasic-l mailto:[email protected] Sent: Tuesday, February 23, 2010 12:05 PM To: randycaus Subject: RE: visualbasic-l Get Current DateTime in format dd/MM/yyyy hh:mm Posted by epurdy on Feb 23 at 3:05 PM Mark this reply as helpfulMark as helpful Try tmpDate = fcCustomFunctions.FormatDate (tmpDate, 'dd/MM/yyyy HH:MM') Look at VB help for format. The Case of the HH:MM vs hh:mm can be significant. From: ismailc via visualbasic-l mailto:[email protected] Sent: Tuesday, February 23, 2010 2:57 PM To: Purdy, Edgar Subject: visualbasic-l Get Current DateTime in format dd/MM/yyyy hh:mm Posted by ismailc on Feb 23 at 3:00 PM Good day, I need to return the current DateTime in format dd/MM/yyyy HH:MM I currently return the current date: mpDate = Date tmpDate = fcCustomFunctions.FormatDate (tmpDate, 'dd/MM/yyyy') Now i'm trying to add time: to get hh:mm tmp=time??
Apr 29, 2009 - Format(Now, 'MM/dd/yyyy') ' Format(Date, 'MM/dd/yyyy') '. I also use VB6 and need to format date in my txt report. Mar 24, 2014 - You can assign any date format as a value to a variable with the date. We assume that you know the basic concepts of MS Excel and Visual Basic for Applications. Text = Format(Now, 'MM/dd/yyyy h:mm:ss tt') End Sub.