如何使用c#使用asp.net在strig中获取服务器日期时间 [英] how to get the server date time in strig using asp.net with c#
本文介绍了如何使用c#使用asp.net在strig中获取服务器日期时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用c#
推荐答案
在下面检查
Check below
DateTime dt=DateTime.Now();
string strDate=dt.ToString("MM/dd/yyyy");
如果您正在谈论托管服务器,那么<br/> 用这个
if you are talking about hosting server then
use this
string str=datetime.now.tostring();
并将服务器连接字符串放入web.config connection strings tag
and put server connection string in web.config connection strings tag
用这条线
Hi,
use this line
String sdate=System.DateTime.Now.ToString();
最好的
All the Best
这篇关于如何使用c#使用asp.net在strig中获取服务器日期时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文