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 from Timespan to int ??

convert from Timespan to int ??

Scheduled Pinned Locked Moved C#
tutorialquestion
4 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.
  • M Offline
    M Offline
    Mr Kode
    wrote on last edited by
    #1

    can i convert Timespan datatype to int. if yes please show me example regards

    D H M 3 Replies Last reply
    0
    • M Mr Kode

      can i convert Timespan datatype to int. if yes please show me example regards

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      It depends on how you want the timespan to be represented as an integer. Many of its properties return an int already.

      Dave

      1 Reply Last reply
      0
      • M Mr Kode

        can i convert Timespan datatype to int. if yes please show me example regards

        H Offline
        H Offline
        Harvey Saayman
        wrote on last edited by
        #3

        what do u want to do with the int?

        Harvey Saayman - South Africa Junior Developer .Net, C#, SQL

        you.suck = (you.passion != Programming)

        1 Reply Last reply
        0
        • M Mr Kode

          can i convert Timespan datatype to int. if yes please show me example regards

          M Offline
          M Offline
          Mbah Dhaim
          wrote on last edited by
          #4

          i think u just use Ticks property of time that timespan but it returns 64 bits integer (long).

          TimeSpan ts = new TimeSpan(DateTime.Now.Ticks);
          long ticks = ts.Ticks;

          dhaim program is hobby that make some money as side effect :)

          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