请教版主大大,比如我们有excel文件需要导入到foxtable,excel表格中的日期/时间这一列是美国的形式,
比如:
Sep 11, 2023 11:59:49 AM PDT
Sep 11, 2023 6:46:11 PM PDT
Nov 14, 2023 8:48:04 AM PST
Nov 14, 2023 1:51:14 PM PST
这就导致foxtable只能将此识别为字符列,而不是日期列,所以就无法进行数据的相应统计,想问下是否有办法识别或者转换之?
谢谢!
[此贴子已经被作者于2024/11/7 19:51:25编辑过]
Dim str As String = "Sep 11, 2023 11:59:49 AM PDT"
Dim dt As Date = DateTime.ParseExact(str, "MMM dd, yyyy HH:mm:ss tt PDT", System.Globalization.CultureInfo.InvariantCulture)
msgbox(dt)
Dim str As String = "Sep 11, 2023 11:59:49 AM PDT"
str = str.replace("PDT","").replace("PST","").trim()
Dim dt As Date = DateTime.ParseExact(str, "MMM dd, yyyy HH:mm:ss tt", System.Globalization.CultureInfo.InvariantCulture)
msgbox(dt)