Results 1 to 5 of 5

Thread: sysdate and time

  1. #1
    Junior Member
    Join Date
    Jul 2008
    Answers
    13

    sysdate and time

    Hi
    every one my query is i want sys date and time coading in C#2008


  2. #2
    Junior Member
    Join Date
    Nov 2008
    Answers
    3

    Re: sysdate and time

    Hai Sunil,
    Is this what u want exactly ?? DateTime.NOW() will always get ur System time not the server time.. Ex if ur system is in India and ur Database Server is in US. When u query the DateTime.NOW() it will always give the time in ur System time.. If u want to get the Server Time u need to TOUCH the DB to know ..

    U have date time Up to
    public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, Calendar calendar, DateTimeKind kind);



    System Date and time..
    C# STMTS...
    Response.Write(DateTime.Now +"<br>");
    Response.Write(DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss ") + "<br>");
    Response.Write(DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss ") + "<br>");
    Response.Write(DateTime.Now.ToString("yyyy/dd/MM hh:mm:ss ") + "<br>");

    Response..

    11/20/2008 4:03:56 PM
    11/20/2008 04:03:56
    20/11/2008 04:03:56
    2008/20/11 04:03:56


  3. #3
    Contributing Member
    Join Date
    May 2008
    Answers
    39

    Re: sysdate and time

    DateTime.Now.ToString();


  4. #4

    Re: sysdate and time

    this code will helpful for you


    namespace Clock
    {
    public partial class Time : Form
    {
    public Time()
    {
    InitializeComponent();
    label1.Text = "";
    label1.Font = new Font("Arial", 28,FontStyle.Italic);
    label1.TextAlign = ContentAlignment.MiddleCenter;
    timer1.Interval = 1000;
    timer1.Start();
    }

    private void timer1_Tick(object sender, EventArgs e)
    {
    label1.Text=DateTime.Now.ToString();

    }


  5. #5
    Junior Member
    Join Date
    Nov 2008
    Answers
    1

    Re: sysdate and time

    Response.Write(System.DateTime.Now.ToString());


  6.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact