问题描述
HI Guys
我目前在生产箱上遇到了一些麻烦。
我的dev和UAT我没有遇到这个问题,但我确实在生产服务器上有这个问题
我正在运行一个导入文件服务,它从FTP位置收集文件导入数据库。
当我导入数据时我收到错误
从字符串转换1/25/2017 7: 59:26 AM键入'日期'无效
我不太确定问题是什么
我尝试过:
目前我从数组中读取数据然后使用以下代码进行转换标准格式的日期
Dim importdate as datetime
ImportedDate = CDate(fields(Count))
Dim FormattedDate As String = ImportedDate。 ToString(dd / MM / yyyy HH:mm:ss)
我也尝试过使用datetime.parse(fields( count).tostring)
HI Guys
I am currently experiencing some trouble on my production box.
On my dev and UAT i have not had this issue but i do have this issue on the production server
I am running a import file service which collects files from an FTP location and imports into the db.
When i import the data i am getting an error
Conversion from string "1/25/2017 7:59:26 AM" to type 'Date' is not valid
I am not too sure what the issue could be
What I have tried:
Currently i am reading the data from an array and then using the following code to convert the date to a standard format
Dim importeddate as datetime
ImportedDate = CDate(fields(Count))
Dim FormattedDate As String = ImportedDate.ToString("dd/MM/yyyy HH:mm:ss")
I have also tried using datetime.parse(fields(count).tostring)
推荐答案
这篇关于如何将日期格式从多种格式转换为标准格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!