Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Date and time

Date and time

Scheduled Pinned Locked Moved Visual Basic
help
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Subjugate
    wrote on last edited by
    #1

    May i know wat is the syntax to use to get the current date and current time. Sometime like that: Date = CurrentDate time = CurrentTime it is urgent pls help...

    M M 2 Replies Last reply
    0
    • S Subjugate

      May i know wat is the syntax to use to get the current date and current time. Sometime like that: Date = CurrentDate time = CurrentTime it is urgent pls help...

      M Offline
      M Offline
      MatrixCoder
      wrote on last edited by
      #2

      Use DateTime.Today for just the date, and DateTime.Now for the date and time. See here for more information.

      S 1 Reply Last reply
      0
      • S Subjugate

        May i know wat is the syntax to use to get the current date and current time. Sometime like that: Date = CurrentDate time = CurrentTime it is urgent pls help...

        M Offline
        M Offline
        momooomooomomo
        wrote on last edited by
        #3

        date = now or now.date date = now.timeofday

        nothing is impossible.....

        1 Reply Last reply
        0
        • M MatrixCoder

          Use DateTime.Today for just the date, and DateTime.Now for the date and time. See here for more information.

          S Offline
          S Offline
          Subjugate
          wrote on last edited by
          #4

          And if i just wan the time only? btw wat should i add so tt the format of the date is 20-11-2006 and the time is 17:36?

          M 1 Reply Last reply
          0
          • S Subjugate

            And if i just wan the time only? btw wat should i add so tt the format of the date is 20-11-2006 and the time is 17:36?

            M Offline
            M Offline
            MatrixCoder
            wrote on last edited by
            #5

            For just the time, use DateTime.Now.ToShortTimeString. And for the date, use DateTime.Now.ToShortDateString.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups