Python论坛  - 讨论区

标题:[python-chinese] 日期字符串如何转换格式?

2006年01月06日 星期五 23:33

shi jizhi shijizhi at gmail.com
Fri Jan 6 23:33:26 HKT 2006

我现在想把"2006-1-6"的日期转换成"060102"的形式,请问PYTHON有没有比较便捷的办法?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060106/1933f302/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年01月07日 星期六 08:33

王鑫 walkline at gmail.com
Sat Jan 7 08:33:25 HKT 2006

VB中可以使用Format函数来改,例如 Print Format ("2006-1-6", "yyyymmdd")
嘿嘿,Python我也是初学,不会

在06-1-6,shi jizhi <shijizhi at gmail.com> 写道:
>
> 我现在想把"2006-1-6"的日期转换成"060102"的形式,请问PYTHON有没有比较便捷的办法?
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>


--
没事喜欢和大家随便聊聊!
-------------------------------------------

My Blog: http://spaces.msn.com/members/walkline
My MSN: walkline_wang81 at hotmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060107/c4dfb2ba/attachment-0001.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年01月07日 星期六 10:54

Devin Deng deng.devin at gmail.com
Sat Jan 7 10:54:26 HKT 2006

试一下这个
from time import strptime, strftime
t = strptime('2006-1-6', '%Y-%M-%d')
print strftime("%y%m%d", t)

....

Devin

在06-1-7,王鑫 <walkline at gmail.com> 写道:
>
> VB中可以使用Format函数来改,例如 Print Format ("2006-1-6", "yyyymmdd")
> 嘿嘿,Python我也是初学,不会
>
> 在06-1-6,shi jizhi <shijizhi at gmail.com> 写道:
> >
> > 我现在想把"2006-1-6"的日期转换成"060102"的形式,请问PYTHON有没有比较便捷的办法?
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> >
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
> >
>
>
> --
> 没事喜欢和大家随便聊聊!
> -------------------------------------------
>
> My Blog: http://spaces.msn.com/members/walkline
> My MSN: walkline_wang81 at hotmail.com
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060107/1dbab29d/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年01月08日 星期日 08:59

shi jizhi shijizhi at gmail.com
Sun Jan 8 08:59:43 HKT 2006

好的,谢谢

在06-1-7,Devin Deng <deng.devin at gmail.com> 写道:
>
> 试一下这个
> from time import strptime, strftime
> t = strptime('2006-1-6', '%Y-%M-%d')
> print strftime("%y%m%d", t)
>
> ....
>
> Devin
>
> 在06-1-7, 王鑫 <walkline at gmail.com> 写道:
> >
> >  VB中可以使用Format函数来改,例如 Print Format ("2006-1-6", "yyyymmdd")
> > 嘿嘿,Python我也是初学,不会
> >
> > 在06-1-6,shi jizhi <shijizhi at gmail.com> 写道:
> > >
> > > 我现在想把"2006-1-6"的日期转换成"060102"的形式,请问PYTHON有没有比较便捷的办法?
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese at lists.python.cn
> > > Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > > Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> > >
> > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > >
> > >
> >
> >
> > --
> > 没事喜欢和大家随便聊聊!
> > -------------------------------------------
> >
> > My Blog: http://spaces.msn.com/members/walkline
> > My MSN: walkline_wang81 at hotmail.com
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to
> > python-chinese-request at lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
> >
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060108/f74da321/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号