Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Phone
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
good
Please Sign up or sign in to vote.

Solution 1

This is so simple to do for anyone..you 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 those..here i give you an simple clock example code for reference that you can understand easily how to build your application..
http://www.c-sharpcorner.com/UploadFile/0524d6/digital-clock-of-windows-7-phone/[^]
http://mobile.tutsplus.com/tutorials/windows/build-a-windows-phone-7-clock-app/[^]
  Permalink  
Comments
Dave Crump at 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 at 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 at 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 at 21-Aug-12 2:23am
   
See some alarm tutorial from below link...see how setted time is operated there..
http://android-er.blogspot.com/2010/10/simple-example-of-alarm-service-using.html
http://alchemiaandroid.altervista.org/AlarmManagerTutorial.html
http://michael.theirwinfamily.net/articles/android/android-creating-alarm-alarmmanager
Dave Crump at 25-Aug-12 1:51am
   
Thanks Ridoy, it really helped me.
ridoy at 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
0 OriginalGriff 6,696
1 Sergey Alexandrovich Kryukov 6,675
2 CPallini 5,315
3 George Jonsson 3,584
4 Gihan Liyanage 2,650


Advertise | Privacy | Mobile
Web01 | 2.8.140921.1 | Last Updated 20 Aug 2012
Copyright © CodeProject, 1999-2014
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