Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Converting A Julian Time To Standard Date Format


I am looking for help on converting a Julian time (1970) value to standard date and time format. Any help would be greatly appriciated.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Converting A Date To Julian Format?
I need to convert a system Date to Julian format. Quick and simple question, how do I do it?

Converting Day Of Year Into Standard Date Format
I am using Access 2000 VBA to pull data from AS/400 tables.  The Dates on the AS400 are 101350 (cyyddd)Referred in our documents as Julian date.
c = Century, yy = Year, and ddd = day of year.  This example needs to convert to 12/16/01.  Can anyone help me make this conversion?

Converting UNIX Time In Milliseconds To Normal Date Time Format?
Hi all. Dont know if this is common or not. Did a search, but found nothing.

I have got a 48 bit date and time value represented in hex being generated on a unix system. The 8 byte date and time is measured from epoch 1(1 Jan 1970, midnight) in milliseconds, ie. the Unix hex data is one extra long number in milliseconds.
I want to convert this to a readable format such as: mm/dd/yy hh:mm:ss.sss

I have some examples taken from some other program runing on Unix system:
Unix data - 7E E6 64 B7 FF 00 (no idea how to convert this to equivalent)
equivalent - 10/20/04 17:31:43.614

Unix data - 5D 2D 26 F5 00 01
equivalent - 12/21/04 10:22:27.677

Thanks.

Converting One Date/time Format To Another.
Hi all,

What I have is a "Sales Order" text file that I import into a tmptable. This table is used to check for duplicate orders from the customer. If there is not duplicate orders it is then written to a Orders table.. what I need to do is convert the date/time format that is imported..

The date/time looks like this.. 2004-06-04T23:07:34-07:00
searching the net I think I found the format. YYYY-MM-DDTHH:mm:ss-zzz

What I need to do is have this converted to MM/DD/YYYY when I am writing it into the orders table...

I am using VB6 with Recordsets to write data into the orders table.

Clark

Converting UNIX TIMESTAMP To Access Date-Time Format
Hi All,

Importing/Linking tables into ACCESS-97 via ssh through ODBC connection to My-SQL.

Dates are in UNIXTIMESTAMP format.

Is there a conversion script available
for free to convert the long integer to an access date-time format ?

Would like to be able to report on date ranges without copying, modifying and or duplicating the fields.
Writing VBA function(s) to return number of days

Function LeapYear(YearInput As Integer) As Boolean
LeapYear = False
If YearInput Mod 400 = 0 Then
LeapYear = True
Else
If YearInput Mod 4 = 0 And YearInput Mod 100 > 0 Then
LeapYear = True
Else
LeapYear = False
End If
End If
End Function

Function DaysInFullYears(YearInput As Integer) As Long
Dim i As Integer
DaysInFullYears = 0

If YearInput < 1970 - 1 Then
For i = YearInput To 1970 - 2
If LeapYear(i) Then
DaysInFullYears = DaysInFullYears + 366
Else
DaysInFullYears = DaysInFullYears + 365
End If
Next i
DaysInFullYears = -DaysInFullYears
End If

If YearInput > 1970 Then
For i = 1970 To YearInput - 1
If LeapYear(i) Then
DaysInFullYears = DaysInFullYears + 366
Else
DaysInFullYears = DaysInFullYears + 365
End If
Next i
End If

End Function
Function DaysInFullMonths(YearInput As Integer, MonthInput As Integer) As Long
Dim DaysInMonth(12) As Integer, i As Integer
DaysInFullMonths = 0

DaysInMonth(1) = 31
If LeapYear(YearInput) Then
DaysInMonth(2) = 29
Else
DaysInMonth(2) = 28
End If
DaysInMonth(3) = 31
DaysInMonth(4) = 30
DaysInMonth(5) = 31
DaysInMonth(6) = 30
DaysInMonth(7) = 31
DaysInMonth(8) = 31
DaysInMonth(9) = 30
DaysInMonth(10) = 31
DaysInMonth(11) = 30
DaysInMonth(12) = 31

If YearInput < 1970 And MonthInput < 12 Then
For i = MonthInput + 1 To 12
DaysInFullMonths = DaysInFullMonths + DaysInMonth(i)
Next i
DaysInFullMonths = -DaysInFullMonths
End If

If YearInput > 1970 And MonthInput > 1 Then
For i = 1 To MonthInput - 1
DaysInFullMonths = DaysInFullMonths + DaysInMonth(i)
Next i
End If

End Function
Function DaysInMonth(YearInput As Integer, MonthInput As Integer, DayInput As Integer) As Long
DaysInMonth = 0

Select Case MonthInput
Case 1, 3, 5, 7, 8, 10, 12
DaysInMonth = 31
Case 4, 6, 9, 11
DaysInMonth = 30
Case 2
If LeapYear(YearInput) Then
DaysInMonth = 29
Else
DaysInMonth = 28
End If
Case Else
DaysInMonth = 0
End Select

If YearInput < 1970 And DayInput <= DaysInMonth Then
DaysInMonth = -(DaysInMonth - DayInput) - 1
End If

If YearInput >= 1970 And DayInput <= DaysInMonth Then
DaysInMonth = DayInput - 1
End If

End Function

Function DaysSince01011970(MthVal As Integer, DayVal As Integer, YearVal As Integer) As Long
DaysSince01011970 = 0

DaysSince01011970 = DaysInFullYears(YearVal) + DaysInFullMonths(YearVal, MthVal) + DaysInMonth(YearVal, MthVal, DayVal)
End Function

long integer value for a date (not going to worry about the time)

Is there anything out there already written that can be called from an Office 97 application

TIA - JBT

Excel Chart Axis Format To Julian Date
I am producing charts in excel though my VB program. Currently the date format for the x-axis is "dd/mm/yyyy hh:mm:ss".
I'd like it to be "yyyy/JulainDate hh:mm:ss"

I know how to switch it in a cell, format(Date, "y") but not on an axis
Anyone know how?

Converting Images To Standard TIF Format
hello all,
i'm new to this forum.
i need to convert a image from FOB(filenet Tif ) format to standard tif format.
can any one please send me some code for this, if not any code for converting from one format to other format.
any help will be appreciated.

thanks you very much
Mkumar

Need Function Or Formula For Converting To/from GMT Seconds And Standard Date
I'm looking for a function or formula to convert a time (in GMT seconds) back to a standard date and time format. Also the reverse.

Thanks in advance.

Convert Number Of Seconds Into A Standard Time Format??
Hi
I'm using Mediaplayer1.Duration to get the length of the audio file. I want to display the CurrentPosition timer into StatusBar Panel ..how do I convert the currentposition in seconds to a standard time format like hh:mm:ss.

Converting One Date Format To Another?
I have a date in YY/MM/DD format and when I use CDate it mixes the day and year, how can I convert it from this YY/MM/DD format to a date format? Changing the YY/MM/DD format of the input date is not an option.

Thanks

Date Format(Converting)
Hai everybody,
I am getting date in "DD/MM/YYYY" format into a text box. Now i want to store that into a access table. What coding should i give for that. If i simply give fields(0).value=text1.text, then it takes the date in "MM/DD/YYYY" format, also it gives error for 23/25/2000. Also please help me to enter a null into the same date/time field.

Advance Thank X to all who helps me.

Converting Date To String Format
Hi,

My situation goes like this: I have two databases, archive.mdb and main.mdb. Main.mdb is the main database in which all transactions are being inputted. Archive.mdb is where old transactions are being archived. Both has tables named tblTimeEntry. tblTimeEntry has a particular field called PostDate. Let's say that archive.mdb is initially empty. The PostDate field in main.mdb may have blank/empty values in it, and so the problem arises when I try running the program and it detects a null situation. I currently have these lines in my program:


Dim datPost as Date
:
:

'datPost takes the value of PostDate from main.mdb to be passed to an SQL statement

If Not IsNull(ADORs.Fields.Item(9).Value) Then
datPost = ADORs.Fields.Item(9).Value
Else
MsgBox "There is a null value in PostDate..."
End If

:
:

What I wanted to happen was still to copy each record despite having a blank/empty PostDate field, and when it does get transferred to archive.mdb, I would like the PostDate field to STILL be empty/blank, and not display any other. Because in my case right now, the record DOES get transferred to archive.mdb, however, the PostDate field has a 12:00AM shown on it. So I'm planning to convert datPost to string first, and then maybe kind of check that string itself for a specific value in order for it to work. I am not quite sure about this approach... I would greatly appreciate any suggestion from you. Thank you very much in advance.

Converting A Date Format I Don't Think Is Supported In VB
I'm trying to convert a date in mm/dd/yy format into a format that is CYYMMDD(anyone who has worked on an IBM iSeries400 might refer to the date format as CYMD, or *CYMD). Anyway, the conversion would be like this 010103(01/01/03) would convert to 1030103. I've tried Cdate and format to no avail. I could be using both functions wrong, but I'm not sure. I am sure that I am not getting the results I want. Any ideas?

Converting Time Format!
Hi all, I am working on a payroll project and I have an attendencemodule, which extracts the values from a delimited text file and savesit into SQL server database table.. . now I want to find the durationbetween two times specified in that table ..the problem is, in thatfile, the time-in and time-out are shown as follows.
Time-In


1030AM

Time-Out
1045PM



now how to I calculate the duration? right now, if anyone can tell mehow to convert the aforementioned time to normal time, I would beobliged.. thanx..

Converting Time Format:
Hi all, I am working on a payroll project and I have an attendence module, which extracts the values from a delimited text file and saves it into SQL server database table.. . now I want to find the duration between two times specified in that table ..the problem is, in that file, the time-in and time-out are shown as follows.
Time-In
1030AM

Time-Out
1045PM


now how to I calculate the duration? right now, if anyone can tell me how to convert the aforementioned time to normal time, I would be obliged.. thanx..

Converting To Date Format Before Export File
Hi there. I am pretty new to Visual Basic but I managed to get my code working somehow but not perfectly done. I'm supposed to export data from a DataGrid to Excel file. It appears that items under Date column is printed out as a 'general' format instead of date. (My 6/12/2001 has turned into 37057 or something..) Is there a code to convert that particular column to Date format when exporting the data? Thanks in advance for your help.

Converting A Input To Date Format [* Not Resolved *]
Hello

I have to text boxes, the user input dateFrom and dateTo. How can l convert these values into a date format, to that they can be used in a SQL query.

SQL Query
Between dateFrom and dateTo

Many thank in advance

Steve

Converting A String Value To Date Format (RESOLVED)
I NEED TO COMPARE TWO DATES WHICH ARE STORED AS STRING VARIABLES, DO I USE CDATE OR DATEVALUE TO CONVERT SUCH? AT PRESENT I AM USING CDATE BUT NOT SURE WHETHER THIS IS APPROPRIATE.
Example: If CDate(RemStartDate) >= CDate(EXREMSTARTDATE) Then
    PLEASE ADVISE
        THANKS




Edited by - KAB on 12/14/2004 1:22:58 AM

Converting Time In (AM/PM) To 24 Hour Format?
Hi guys...

How do i convert my time in AM/PM to 24 hour format?? Thanks!!

Regards
Vivien

Converting Tot Min To Time Format (not 10ths)
Does anyone know how I can convert total minutes to hr and minutes (stnd time format)?

Thanks,
Marc



90 to 1.30

Thanks,
Marc

Converting Whole Number In Sec To Time Format
How would you convert a whole number in seconds like 2525353 to be in the hh:mm:ss format? I have tried using format and it doesnt convert it correctly any help?

Converting Variable To Time Format
hi guys,

i would like to know how it is possible ot convert integers into time format

in my project i have two integers
"seconds" & "minutes" and they hold those things respectivly. What i need to do is add those together and then add that time to the current time to display a date in the future

later i will also need to subtract those two final dates for wihch i have found fuction datediff

Code:lngHowLong = DateDiff("n", Text1, Now)

i assume this will work

sorry for vagueness i cant explain it to well

thecubical

Excel Converting Text To Unwanted Date Format
I have a VB6 app that exports information from a purchasing data base to Excel. Vendors get the spreadsheets and then fill them in to "bid" on sales.

The problem lies in the product numbers that are used in the database. The naming convention is six alphanumerics. Apricot jam might have the designation of APR01 in the database. Apricot jelly might be designated as APR02. As you may have already guessed, when I put these product numbers into an Excel spreadsheet, the spreadsheet converts it to 1-Apr or 2-Apr, assuming it is a date.

How can I stop Excel from turning APR01 into 1-Apr?

Thanks,
Frank

Converting Double Back To Time Format
Hi I would like to find out how i can convert a double back to time format. I know how to convert time to a double.
When i convert 01:00 to a double it gives me this answer: 4.16666666666667E-02 When i try to reverse it suddenly a 01:00 becomes a 01:10

The formula i use to convert the time is
((Hours * 3600) + (Minutes * 60)) / 86400

pleas help?!?

Setting Long - Short Date Format In Date Time Settings
How can i set the Date Time Setting Format in Control Panel

i m usiing window Xp


also i want the date format in dd/MM/yyyy

Date && Time Values In Date And String Format Differ
The program (debug) output below lists the last modification time of two files. File 1 is stored on a NTFS medium, file 2 sits on a FAT medium.

In order to be able to compare these dates, I need to round the odd seconds of the NTFS file up (FAT files have only even second values).

The lines after the file headers show the date & time value before and after the rounding, in date, double precision and string format.

file 1 (NTFS)
= 2005-07-12 08:57:09 = 38545,3730208333 = 2005-07-12 08:57:09
after rounding up
= 2005-07-12 08:57:10 = 38545,3730324074 = 2005-07-12 08:57:10

file 2 (FAT)
= 2005-07-12 08:57:10 = 38545,3730324074 = 2005-07-12 08:57:10

The strange thing is that when comparing these values, they appear to be different (!) both in date and double data format, not in string format.

2005-07-12 08:57:10 > 2005-07-12 08:57:10 (date format)
38545,3730324074 > 38545,3730324074 (double precision format)
2005-07-12 08:57:10 = 2005-07-12 08:57:10 (string format)

Any idea where this difference comes from?

Rounding up was done with DateAdd.

VB version 6, on XP.
Boiled down code has been attached.

Converting Date && Time Into Integer
I have created a database to work out Total Payment based on Pay per Hour and numbers of hours worked...

Pay per Hour = Integer
No. of Hours = Date & Time

The above are the formats used for rate of pay and no of hours.

I can't multiply them together as they are of towo different formats. So what I need to do is convert the No of hours into an Integer.. Can anyone please help me with this?

Thank you in advance

Edit: Sorry Rate of Pay is currency... not Integer. I still need to convert the No of Hours into an Integer though as I can't use Date & Time in caluculations..

Converting A String To A Date/Time
I have in a string "10:40 AM".
I would like to covert the "10:40 AM" to a Date/Time or double.

Reason:

To get the DateDiff between "10:40 AM" and Now/Time.


Thanks in advance.

Converting String To DATE && TIME
In VB there are many functions available to convert strings to date for eg.

DateValue, cdate . If these functions were fed in with a string containing date and time in the format "dd.mm.yyyy hh:mm:ss" These functions convieniently dropout the time part and convert the date only. for example

? datevalue("01.12.2001 13:50:12")
01.12.2001 ' Drops pot the time

? Cdate("01.12.2001 13:50:12")
01.12.2001 13:50:12 ' this one doesnt drop out the time but doesnt have any regard for it I mean

Cdate("01.12.2001 13:50:12") = Cdate("01.12.2001 21:50:12") is the same. I hope u understand what i mean.

Can anyone tell me some function which actually regards a difference in the time too ?

Regards

Nikhil

Julian Format Like Excel
I would like a way to get the julian format like excel shows. All the code i have seen does not match the julian format like excel. Does anyone know how this is acheived?

Convert Time Ticks Into Date Time/string Format
I have time ticks and wanted to convert into string or date time format in visual basic 6.

Thanks in advance.

Excel Date Calculation - Uses Julian Date
I need an excel formula that converts a date in this format 2003/01/01 00:57:38:002
to the Year + the julian date/365

so for this example it would give 2003.0027

and for 2003/02/11 02:57:38:002 = 2003.1151

How To Convert Current Date To Julian Date
Hi,

I would be very thankful if anyone can help me with this date conversion from the Current Date in DD/MM/YYYY format to Julian Date.

Many Thanks in advance,
Praveen.

Julian Date
Hi,
I am trying to convert dates to Julian so that I can use them as the indexes for an array. I can't find a VB function to do this. Can anyone point me in the right direction?
Thanks in advance for any help.
Frank

Julian Date
I have bene told that the Julian date function will prevent a innvalid date from been entered, can somebody please post the procedur.

By an invalid date i mean liek 30th February
And to take into counf ot leap years

Thanks

Julian Date
Thanks to some code I found on this forum, I have the following code to convert a calendar date to a Julian date:


VB Code:
Private Sub ConvertDateToJulian(MyDate As String)Dim JYear As IntegerDim JDate As String JYear = Right(MyDate, 1)JDate = Right(MyDate, 4) + Format(DateDiff("y", "01-Jan-" & JYear, MyDate) + 1, "0##")text1.text = jdateMsgBox JDate End Sub  Private Sub cmdConvert_Click()   ConvertDateToJulian txtCalDt.Text        End Sub


However, the problem I have is that this code is placing it in a msgbox. As long as I keep the code in to allow the Msgbox to pop up, I can also place the value in a text box. It doesn't work if the msgbox doesn't pop up. Is there a way I can run this without having a msgbox popping up?

Thanks-

Julian Date
Hi

I would like to calculate the Julian date for example 11/02/2004 manually. I don't want to use any functions like Datediff etc.

Can anyone help?

Thnx

Getting Julian Date
Hi All,
I want to know if there is a WinAPI which i can use to convert from
Gregorain date to Julian Date format.
Or is there any other method in VB to do this.

Mak

Julian Date
How can I get the Julian date in VB6?

Julian Date
I was wondering if anyone knows how to get the Julian Date in VB.
Eg Todays Julian date is 220

Any ideas
Cheers
JK

Julian Date
I need to detirmine a Julian date using VB6.0. Does anyone have any suggestions or resources that I might be able to use to figure out haw this is done?

Thanks in advance for your assistance!

wwyant

Julian Date
Is it possible to convert a julian date into an actual date? If so, how?

Julian Date
How can I Convert Julian Date to vb format date?

Julian Date Converter
Does anybody know where I can find a Julian to Gregorian date converter?

Julian Date Conversion
Need a example of a julian to gregorian,etc. date routine for VB6. Any help would be appreciated. Thanks.

Julian Date Conversion
I am trying to convert a julian date (02335) to a mmddyy format.

The follow code

x=cdate("02335")

returns a value of 5/23/1906

How can I have it return the correct date (expecting 12/06/02)

Or

Is there another function which will work?

Thanks
Geod

 

Julian Date Conversion
Can someone please tell me what is wrong with my code below. I am attempting to extract a date of birth from a text file. I am able to convert the day and month portion of the date as seen at strDate3 but when I try to get the year, I get a "Run-Time Error 13, Type Mismatch"
In the text file the date of birth is stored as yyyyddd which is 1966031 for (01/31/66). I account for leap years by using the code "If ((strYear3 Mod 4 = 0) And (strYear3 Mod 100 <> 0) Or (strYear3 Mod 400 = 0)) Then .....

It is the if statement that generates the error message. When I comment out the "strYears3 = Mid(PULL_record, 229, 4), the code runs and returns the correct day and month

Dim strYear3
Dim strDate3
Dim Date_of_Birth As String
Dim strJulianDate
        
        
'strYear3 = Mid(PULL_record, 229, 4)
strDate3 = Mid(PULL_record, 233, 3)
strJulianDate = strYear3 & strDate3

If ((strYear3 Mod 4 = 0) And (strYear3 Mod 100 <> 0) _
 Or (strYear3 Mod 400 = 0)) Then
.............

 I put a debugger before:
 strYear3 = CDbl(Mid(PULL_record, 229, 4))

It now fails on that line of code.

The immediate window shows * *

Curiously, when I hover the mouse over strYear3 anywhere, it has the correct year. It is failing on that line of code but has the correct data in it.

Julian Date Conversion
Can someone please tell me what is wrong with my code below. I am attempting to extract a date of birth from a text file. I am able to convert the day and month portion of the date as seen at strDate3 but when I try to get the year, I get a "Run-Time Error 13, Type Mismatch"
In the text file the date of birth is stored as yyyyddd which is 1966031 for (01/31/66). I account for leap years by using the code "If ((strYear3 Mod 4 = 0) And (strYear3 Mod 100 <> 0) Or (strYear3 Mod 400 = 0)) Then .....

It is the if statement that generates the error message. When I comment out the "strYears3 = Mid(PULL_record, 229, 4), the code runs and returns the correct day and month

Dim strYear3
Dim strDate3
Dim Date_of_Birth As String
Dim strJulianDate


'strYear3 = Mid(PULL_record, 229, 4)
strDate3 = Mid(PULL_record, 233, 3)
strJulianDate = strYear3 & strDate3

If ((strYear3 Mod 4 = 0) And (strYear3 Mod 100 <> 0) _
Or (strYear3 Mod 400 = 0)) Then
.............

I put a debugger before:
strYear3 = CDbl(Mid(PULL_record, 229, 4))

It now fails on that line of code.

The immediate window shows * *

Curiously, when I hover the mouse over strYear3 anywhere, it has the correct year. It is failing on that line of code but has the correct data in it. I have attached a screenshot of the latest error.

Copyright 2005-08 www.BigResource.com, All rights reserved