Archive

Archive for the ‘Date and Time’ Category

How to Calculate Difference Between Two Dates Using VB6

September 1st, 2009 Masino Sinaga No comments

This following code will show you how to calculate difference between two dates by using Visual Basic 6. The calculation result will give you an output that contains of the difference between those two dates in format: Days, Hours:Minutes:Seconds. The both dates must be in complete format. For example: the first date is March 1, 2002 17:18:00, and the second date is September 1, 2002 09:42:30. After being calculated, then the output will give you the result as follow: 183 day(s), 16:24:30. It means: The difference between those two dates is: 183 days, 16 hours, 24 minutes, and 30 seconds. Read more…

  • Share/Bookmark

How to Convert 10 Digits Numeral to The Date Value?

August 29th, 2009 Masino Sinaga No comments

I have hundreds of records that need to be imported from one table and database (let’s say that this is the first database) to another table in different database (and the last one is the second database). Unfortunately, one of the columns in the table in first database has the Date value in 10 digits numeral format. For example: 1206980969. Actually, this value equals with March 31, 2008 16:29:29 on UTC. Then, how do I convert that 10 digits numeral to the Data value since the column in the second database is a Date field type? And how do I convert again that date according to my local time? Read more…

  • Share/Bookmark

How to Convert 5 Digits Numeral to The Date Value?

August 28th, 2009 Masino Sinaga No comments

A few days ago, a friend of mine asked me for help. He wanted to export his data from Excel file into Access database file. There were about sixteen thousand rows in Excel that have to be exported into Access. One of the columns in that Excel had a Date data. Unfortunately, most of those rows have the 5 digits numeral data, and not in the real Date Value data. For example, there was a row with value ‘38353. As we know, this is not a valid Date, right? Besides that, there is a ‘ character before the value itself. In this case, that value become a String and not a numeral value anymore. Read more…

  • Share/Bookmark