Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9152381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:01:42+00:00 2026-06-17T12:01:42+00:00

As in title. I write a easy timer , which set time and date

  • 0

As in title. I write a easy timer , which set time and date . Time works well , but date not.
It shows a year and a day , but not month . Why ?

My code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication_timer
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            int h = DateTime.Now.Hour;
            int m = DateTime.Now.Minute;
            int s = DateTime.Now.Minute;

            int d = DateTime.Now.Day;
            int y = DateTime.Now.Year;
            int t = DateTime.Now.Month;

            label2.Text = DateTime.Now.ToString("dd/tt/yy");

            label1.Text = DateTime.Now.ToString("hh:mm:ss");

        }

        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Start();
        }

        private void label2_Click(object sender, EventArgs e)
        {

        }
    }
}

Result of this code :

time eg : 11:34:23
date eg : 20--2013

result must change to :

time eg : 11:34:23
date eg : 20/01/2013

Could you help me how to solve this problem ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:01:43+00:00Added an answer on June 17, 2026 at 12:01 pm
    label2.Text = DateTime.Now.ToString("dd/MM/yyyy");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK. The title of this qiestion is not easy to decode, but let me
Some users like to write post title all in uppercase, which is completely annoying.
Sorry for the ambiguous title but I'm doing the following to write a simple
My question is not clear at title [i can not write it exactly] e.g
Didn't really know how to title this. First time writing a gem so not
I know the title sounds easy but I am looking for an example that
Sorry if title is not too clear but I think it's about right. NEhow,
I don't know how to write the title for this question. The existing title
foreach (var book in query) { Response.Write(book.Title); foreach (var author in book.Authors) { Response.Write(
It was as hard to write a good title for this issue as it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.