+ Reply to Thread
Results 1 to 3 of 3

add current time (hh:mm:ss) as well as current date (dd:mm:yyyy) into the code

  1. #1
    Registered User
    Join Date
    04-24-2012
    Location
    Bridgwater
    MS-Off Ver
    Excel 2010
    Posts
    16

    Question add current time (hh:mm:ss) as well as current date (dd:mm:yyyy) into the code

    Hi there,

    I have the following program:

    Please Login or Register  to view this content.
    I will like to know how can i add the current time as well as the current date (which is already included in the code above - line 2) to the file that i am pasting by this code.

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: add current time (hh:mm:ss) as well as current date (dd:mm:yyyy) into the code

    Couldn't you just expand the format?

    Format(Now, "mm-dd-yyyy hh:mm:ss")

    Since Now gives both.
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    04-24-2012
    Location
    Bridgwater
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: add current time (hh:mm:ss) as well as current date (dd:mm:yyyy) into the code

    Hi Jeff,

    Many Thanks for your reply.

    That is what i tried doing but it returned an error and now i can see why:

    Format(Now, "mm-dd-yyyy hh:mm:ss") --> this the wrong code and
    Format(Now, "mm-dd-yyyy hh-mm-ss") --> this is the right one.

    I feel like a right plonker!!! lol....

    many thanks for your help jeff, simple mistake to make, ey!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1