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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. dateTime format

dateTime format

Scheduled Pinned Locked Moved C#
helpquestion
3 Posts 2 Posters 4 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.
  • D Offline
    D Offline
    dhol
    wrote on last edited by
    #1

    Hi I have doen a program, her is some part of the coding DateTime current = System.DateTime.Now; DateTime end = DateTime.Parse(textBox1.Text); TimeSpan ts = current.Subtract(end); I am calculating as follows. But now i want to know the default format of dateTime. in texBox1.text, i will give a time.... then that sould be calculated fromteh current time of teh system. so i want to give only the time like 3:00 ..i mean in hrs and minutes.... so how do i format these. pls help me to do this . dhol

    C 1 Reply Last reply
    0
    • D dhol

      Hi I have doen a program, her is some part of the coding DateTime current = System.DateTime.Now; DateTime end = DateTime.Parse(textBox1.Text); TimeSpan ts = current.Subtract(end); I am calculating as follows. But now i want to know the default format of dateTime. in texBox1.text, i will give a time.... then that sould be calculated fromteh current time of teh system. so i want to give only the time like 3:00 ..i mean in hrs and minutes.... so how do i format these. pls help me to do this . dhol

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Try this[^] Christian Graus - Microsoft MVP - C++

      D 1 Reply Last reply
      0
      • C Christian Graus

        Try this[^] Christian Graus - Microsoft MVP - C++

        D Offline
        D Offline
        dhol
        wrote on last edited by
        #3

        Hi I have done a program using system.threading.timer.... now in that i will input the time in a textbox, say 03:00 pm.. now i have to format in that way, i mean hour:minute.. here is the part of my coding //system timing DateTime current = System.DateTime.Now; //texbox,wher i wil give time DateTime end = DateTime.Parse(textBox1.Text); .//then i willcalculate the timespan. TimeSpan ts = current.Subtract(end); but only in the second part of my coding. i willgive as 03:00 pm in the textbox,which should be accepted. so please help me how to format the datetime. I read from MSDN and articles to use {t} , but i dont know exactly how to implement.. so please help me by explaining how to code that part.. js

        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