从数组转换日期 [英] Converting date from array

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

问题描述

我转换数组,在日期列中,格式为dd / MM / yy,我需要在yyyyddMM中转换该日期格式。我试过parse,parseexact但返回了一个

错误字符串无法转换为日期或字符串未被识别为有效的DateTime。或者日历System.Globalization.GregorianCalendar不支持字符串表示的日期时间。





请帮助我。

解决方案

DateValue(CDate(sDate))。ToString(yyyyddMM)

Im converting an array, in the date column, the format is dd/MM/yy, i need to convert that date format in yyyyddMM. I tried parse, parseexact but returns an
errors "String cannot be converted into date" or "String was not recognized as a valid DateTime." or "The DateTime represented by the string is not supported in calendar System.Globalization.GregorianCalendar."


Please help me.

Many Thanks!

解决方案

DateValue(CDate(sDate)).ToString("yyyyddMM")


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

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