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. How to Convert 10 digit Number to Date

How to Convert 10 digit Number to Date

Scheduled Pinned Locked Moved C#
tutorialhelp
7 Posts 4 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.
  • B Offline
    B Offline
    basantakumar
    wrote on last edited by
    #1

    Hi, I have one software which gives me 10 digit Number for date. How could I convert that 10 digit number to actual date. Example :- The output given by software is 1251983760 for the date 03-09-2009. Please help me to convert that number to actual date.

    R 1 Reply Last reply
    0
    • B basantakumar

      Hi, I have one software which gives me 10 digit Number for date. How could I convert that 10 digit number to actual date. Example :- The output given by software is 1251983760 for the date 03-09-2009. Please help me to convert that number to actual date.

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      I'm not a .NET expert, but I'm assuming that the numeric value corresponds to number of ticks (from some standard base time?) Have you looked at the constructors of DateTime[^] structure?

      It is a crappy thing, but it's life -^ Carlo Pallini

      T N 2 Replies Last reply
      0
      • R Rajesh R Subramanian

        I'm not a .NET expert, but I'm assuming that the numeric value corresponds to number of ticks (from some standard base time?) Have you looked at the constructors of DateTime[^] structure?

        It is a crappy thing, but it's life -^ Carlo Pallini

        T Offline
        T Offline
        Thomas Krojer
        wrote on last edited by
        #3

        can be the seconds since 1970/01/01 (or maybe 1969/12/31)

        T 1 Reply Last reply
        0
        • T Thomas Krojer

          can be the seconds since 1970/01/01 (or maybe 1969/12/31)

          T Offline
          T Offline
          Thomas Krojer
          wrote on last edited by
          #4

          I tried it: it´s the number of seconds since 1970/01/01 00:00

          DateTime smq = new DateTime(1970, 1, 1);
          Console.WriteLine("Date {0} + {1} seconds = {2}", smq.ToString(), 1251983760.ToString(), smq.AddSeconds(1251983760).ToString());

          B 1 Reply Last reply
          0
          • R Rajesh R Subramanian

            I'm not a .NET expert, but I'm assuming that the numeric value corresponds to number of ticks (from some standard base time?) Have you looked at the constructors of DateTime[^] structure?

            It is a crappy thing, but it's life -^ Carlo Pallini

            N Offline
            N Offline
            N a v a n e e t h
            wrote on last edited by
            #5

            Happy to see you posting on C# forum. :)

            Navaneeth How to use google | Ask smart questions

            R 1 Reply Last reply
            0
            • N N a v a n e e t h

              Happy to see you posting on C# forum. :)

              Navaneeth How to use google | Ask smart questions

              R Offline
              R Offline
              Rajesh R Subramanian
              wrote on last edited by
              #6

              Well, I've started to lurk here to see if I can learn something new (the plan of learning .NET properly, which I had been procrastinating for a very long time). :) While in the process of reading posts and leeching knowledge off the C# Gurus, I may answer a couple of easy posts, being wrong here and there. You guys must be watchful and warn me on such occasions! :laugh:

              It is a crappy thing, but it's life -^ Carlo Pallini

              1 Reply Last reply
              0
              • T Thomas Krojer

                I tried it: it´s the number of seconds since 1970/01/01 00:00

                DateTime smq = new DateTime(1970, 1, 1);
                Console.WriteLine("Date {0} + {1} seconds = {2}", smq.ToString(), 1251983760.ToString(), smq.AddSeconds(1251983760).ToString());

                B Offline
                B Offline
                basantakumar
                wrote on last edited by
                #7

                Thanks bro. That number was in seconds since 1970/01/01 00:00;

                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