Click here to Skip to main content
13,096,760 members (95,103 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi all,
I am new in Windows Phone development.
I want to know how to set and get the time.
How to show current time.
Posted 20-Aug-12 5:56am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This is so simple to do for need to try it by yourself...Do you google it?If you expect code from here then it willn't increase your coding skill.Ok,then lets see..

DateTime.Now.ToString() will show you current time.You can use different foramts for that..suppose if you use DateTime.Now.ToString("hh:mm:ss")then it will display time as hour,minute,second format.If you use DateTime.Now.ToString("hh:mm:ss tt") then it will represent whether it is AM or PM.There are lot of articles in MSDN for it..see i give you an simple clock example code for reference that you can understand easily how to build your application..[^][^]
Dave Crump 20-Aug-12 14:12pm
Thank you for the reply and help,
I did a lots of research about coding. I am also so much volunteer to learn.

It was not my request. My request is, that set the time by the user with scrolling a TextBox Control in a scrollview container.

I tried many ways to get the String's Date and time but, no success.

Thank in advance
ridoy 20-Aug-12 14:32pm
Set the time?Is it like alarm application?and what you actually need?how to set time or how to get string representation of date and time?
Dave Crump 20-Aug-12 19:16pm
Yes, exactly like Alarm Setting.
The scenario is like that; User has to set the time, for example like 12:30.
I have to get "12:30" for later use. Because I have to search based on the setted time.
ridoy 21-Aug-12 2:23am
See some alarm tutorial from below link...see how setted time is operated there..
Dave Crump 25-Aug-12 1:51am
Thanks Ridoy, it really helped me.
ridoy 25-Aug-12 2:00am
glad to help you..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 20 Aug 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100