设置时间并获取时间 [英] Set the time and retrieve it

查看:95
本文介绍了设置时间并获取时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我是Windows 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.

推荐答案

这对任何人都非常简单.从这里期待代码,那么它不会增加您的编码技能.确定,然后让我们看看..

DateTime.Now.ToString()将为您显示当前时间.您可以为此使用不同的格式..如果使用DateTime.Now.ToString("hh:mm:ss"),则它将以小时,分钟,第二种格式.如果使用DateTime.Now.ToString("hh:mm:ss tt"),则它将表示它是AM还是PM.MSDN中有很多关于它的文章.您将获得一个简单的时钟示例代码以供参考,您可以轻松地了解如何构建您的应用程序. 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/ [
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/[^]


这篇关于设置时间并获取时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆