M Mahares Expert Licensed User Longtime User Oct 6, 2012 #1 The following statement in FTP to extract the date and time stamp does not include the time. How can I make it show both the date and time: Code: Copy DateTime.Date(Files(i).Timestamp) 'shows 10/05/2012 I tried: Code: Copy DateTime.Time(Files(i).Timestamp) 'this shows the time as: 00:00:00. Thank you
The following statement in FTP to extract the date and time stamp does not include the time. How can I make it show both the date and time: Code: Copy DateTime.Date(Files(i).Timestamp) 'shows 10/05/2012 I tried: Code: Copy DateTime.Time(Files(i).Timestamp) 'this shows the time as: 00:00:00. Thank you
Erel B4X founder Staff member Licensed User Longtime User Oct 7, 2012 #2 I've tested it here and it works fine. The same date and time return as the values displayed with a FTP client. Upvote 0
I've tested it here and it works fine. The same date and time return as the values displayed with a FTP client.
M Mahares Expert Licensed User Longtime User Oct 7, 2012 #3 @Erel: I would like to convert the server file date to ticks or datetime.ticksperhour, but the conversion does not include the time. It converts to the ticks as of 0 hr am (midnight) of the file date: The quesion is: How do you get the ticks equivalent of a file on the server with a date of say: 10/7/2012 and time of 7:30 AM I am trying to use the below but I know I need the time in there too: Code: Copy dim ServerBaseDateTime as long ServerBaseDateTime = DateTime.DateParse(DateTime.Date(Files(i).Timestamp))/DateTime.TicksPerHour Upvote 0
@Erel: I would like to convert the server file date to ticks or datetime.ticksperhour, but the conversion does not include the time. It converts to the ticks as of 0 hr am (midnight) of the file date: The quesion is: How do you get the ticks equivalent of a file on the server with a date of say: 10/7/2012 and time of 7:30 AM I am trying to use the below but I know I need the time in there too: Code: Copy dim ServerBaseDateTime as long ServerBaseDateTime = DateTime.DateParse(DateTime.Date(Files(i).Timestamp))/DateTime.TicksPerHour
M Mahares Expert Licensed User Longtime User Oct 7, 2012 #4 In order to get the TIME of the server file accounted for beside the file date, I used the following tedious code. It seems to yield the correct ticks. But if someone has a simpler way, I welcome it. Thanks: Code: Copy Dim ServerBaseDateTime as long ServerBaseDateTime = (DateTime.DateParse(DateTime.Date(Files(i).Timestamp)) _ + DateTime.TimeParse(DateTime.Time(Files(i).Timestamp)) _ -DateTime.DateParse(DateTime.Date(DateTime.Now)) )/DateTime.TicksPerHour Upvote 0
In order to get the TIME of the server file accounted for beside the file date, I used the following tedious code. It seems to yield the correct ticks. But if someone has a simpler way, I welcome it. Thanks: Code: Copy Dim ServerBaseDateTime as long ServerBaseDateTime = (DateTime.DateParse(DateTime.Date(Files(i).Timestamp)) _ + DateTime.TimeParse(DateTime.Time(Files(i).Timestamp)) _ -DateTime.DateParse(DateTime.Date(DateTime.Now)) )/DateTime.TicksPerHour
Erel B4X founder Staff member Licensed User Longtime User Oct 8, 2012 #5 DateTime.Time(Files(i).Timestamp) should return the time component (hours and minutes). It seems like the FTP server omits the time component for old files. Your server may behave differently. Upvote 0
DateTime.Time(Files(i).Timestamp) should return the time component (hours and minutes). It seems like the FTP server omits the time component for old files. Your server may behave differently.