时间格式转换 [英] time format conversion

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

问题描述

嗨...


我有这种格式2003-12-01 18:46:20.0


并希望它能够是01-12-2003 18:46:20


我知道它可以通过字符串切割和爆炸来完成但是它必须是一个

使用时间函数的更好方法....


任何帮助都会受到影响..


Thanx

Hi...

I have this format 2003-12-01 18:46:20.0

And would like it to be 01-12-2003 18:46:20

I know it can be done vis string cuts and explodes but ther''s got to be a
better way using time functions....

Any help would be appriciated..

Thanx

推荐答案

setlocale(LC_TIME,所需时区)


" point" < PO *** @ caanNOproductionSPAM.com> schreef在bericht

新闻:bq ******** @ enews3.newsguy.com ...
setlocale (LC_TIME, "desired timezone")

"point" <po***@caanNOproductionSPAM.com> schreef in bericht
news:bq********@enews3.newsguy.com...
嗨...
我有这种格式2003-12-01 18:46:20.0

并希望它是01-12-2003 18:46:20

我知道它可以通过字符串剪切和爆炸来完成,但是使用时间函数是一种更好的方式....

任何帮助都会受到影响..

Thanx
Hi...

I have this format 2003-12-01 18:46:20.0

And would like it to be 01-12-2003 18:46:20

I know it can be done vis string cuts and explodes but ther''s got to be a
better way using time functions....

Any help would be appriciated..

Thanx



point写道:
嗨......

我有这种格式2003-12-01 18:46:20.0

并希望它是01-12-2003 18:46:20
Hi...

I have this format 2003-12-01 18:46:20.0

And would like it to be 01-12-2003 18:46:20




尝试此代码段...



Try this code snippet...


before =" 2003-12-01 18:46:20.0" ;;

before = "2003-12-01 18:46:20.0";


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

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