date and time RRS feed

  • Question

  • Hi.I fill the textboxes by using that graphical clock and the graphical calender.I did it in php. is it possible in c sharp? 

    • Edited by Ali_Lonbar Thursday, April 18, 2019 9:02 AM
    Thursday, April 18, 2019 9:02 AM

All replies

  • If you did it in PHP it means that it is a web application. In this case, all the tricks to show the calendar and clock happen on the html side of things, by means of a combination of html attributes, css styles, and javascript code. In any case, it all happens on the client side. It won't matter what language you are using on the server side of your application. So if your server-side is written in C#, your clock and calendar will still be shown in the browser as long as the html that you are sending to the browser is the same that you were sending from PHP. Neither PHP nor C# "know" anything about these graphics, it's all in the design of the HTML page.
    Thursday, April 18, 2019 11:43 AM
  • There is a VB.NET solution to this that is close to what you have shown. Add the class project to your C# solution, build, add the control which will show in the toolbox.

    Here I've set some colors via the property window.

    Code to set the time

    using System;
    using System.Windows.Forms;
    namespace WindowsFormsApp1
        public partial class Form1 : Form
            public Form1()
            private void Form1_Load(object sender, EventArgs e)
                clock1.UtcOffset = 

    To get the current data time, .Value is a DateTime type.


    Then here are two in C#

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    profile for Karen Payne on Stack Exchange

    Thursday, April 18, 2019 11:58 AM
  • This forum is for C#-specific questions only. Please identify the UI framework you're using so it can be moved to the appropriate forum (Windows Forms, WPF, UWA, ASP.NET, etc).

    Michael Taylor

    Thursday, April 18, 2019 1:58 PM
  • Hi

    Thank you for posting here.

    Meanwhile, I noticed that you have some other threads that not be closed. If you have solved the problem, please post "Mark as answer" to the appropriate answer.​​​​​​​

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Friday, April 19, 2019 6:13 AM