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. C#
  4. Convert DateTine to a Number?

Convert DateTine to a Number?

Scheduled Pinned Locked Moved C#
question
4 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.
  • R Offline
    R Offline
    redfish34
    wrote on last edited by
    #1

    Is there such a conversion? I would like to use DateTime as part of a unique identifier. I could create a number by appending year + month + day + hour + minute + second + ticks, but i am hoping i could access the number representation of DateTime like i could in VB6.

    G R R 3 Replies Last reply
    0
    • R redfish34

      Is there such a conversion? I would like to use DateTime as part of a unique identifier. I could create a number by appending year + month + day + hour + minute + second + ticks, but i am hoping i could access the number representation of DateTime like i could in VB6.

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Use the Ticks property. --- b { font-weight: normal; }

      1 Reply Last reply
      0
      • R redfish34

        Is there such a conversion? I would like to use DateTime as part of a unique identifier. I could create a number by appending year + month + day + hour + minute + second + ticks, but i am hoping i could access the number representation of DateTime like i could in VB6.

        R Offline
        R Offline
        Ravi Bhavnani
        wrote on last edited by
        #3

        The ToBinary() method will return the DateTime's numeric value. /ravi My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

        1 Reply Last reply
        0
        • R redfish34

          Is there such a conversion? I would like to use DateTime as part of a unique identifier. I could create a number by appending year + month + day + hour + minute + second + ticks, but i am hoping i could access the number representation of DateTime like i could in VB6.

          R Offline
          R Offline
          redfish34
          wrote on last edited by
          #4

          Both advice is good. Thanks for the "kick" in the right direction!

          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