473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to Convert Julian Date to Regular Date for All of 2020

I've been making several changes to get the formula to convert over to regular dates for 2020 in date order for reports,

Expand|Select|Wrap|Line Numbers
  1. Function ConvertJulian(JulianDate As Long)
  2.   ConvertJulian = DateSerial(2000 + Int(JulianDate / 2000), 1, JulianDate Mod 2000) + 3651
  3. End Function
this was working, now it's not.
Dec 22 '19 #1

✓ answered by cactusdata

You can use this expression (corrected):

Expand|Select|Wrap|Line Numbers
  1. TrueDate = DateSerial(Left(JulianDate, 5) \ 1000, 1, 
  2. Left(JulianDate, 5) Mod 1000)
or, in a query:

Expand|Select|Wrap|Line Numbers
  1. TrueDate: DateSerial(Left([JulianDate], 5)\1000,1,Left([JulianDate],5) Mod 1000)
What does the /0011 part mean?

8 2547
Nauticalgent
100 64KB
Here is the code I use:

Expand|Select|Wrap|Line Numbers
  1. Public Function DateToJulian(dt As Date) As String
  2.     DateToJulian = Right(Year(dt), 2) & Format(DateDiff("d", DateSerial(Year(dt), 1, 0), dt), "000")
  3. End Function
  4.  
Dec 22 '19 #2
cactusdata
214 Expert 128KB
That's a weird function.
Could you provide some sample values for your JulianDate and what dates you expect these to be converted to?
Dec 22 '19 #3
I run jobs on mainframe that works with julian dates. I then ftp my reports down to a txt file. I've created Macros for each applications that have their own schedules. I need the julian dates to convert overt to regular date mm/dd/yy. I run a job that has the 365 or as 2020 has 366 days as julian dates to make sure this formula will work.
Dec 23 '19 #4
cactusdata
214 Expert 128KB
OK.
Could you please provide some sample values for your JulianDate and what dates you expect these to be converted to?
Dec 23 '19 #5
Trying to convert all 2020 dates from julian date/start time
20001/0011
20002/0011
20003/0011
20004/0011
... to convert over to the below desire result.

01/01/20
01/02/20
01/03/20
01/04/20
.... for the entire 2020 year
Dec 23 '19 #6
cactusdata
214 Expert 128KB
You can use this expression (corrected):

Expand|Select|Wrap|Line Numbers
  1. TrueDate = DateSerial(Left(JulianDate, 5) \ 1000, 1, 
  2. Left(JulianDate, 5) Mod 1000)
or, in a query:

Expand|Select|Wrap|Line Numbers
  1. TrueDate: DateSerial(Left([JulianDate], 5)\1000,1,Left([JulianDate],5) Mod 1000)
What does the /0011 part mean?
Dec 24 '19 #7
the /0011 is the start time of my test data so the jobs will fall out on the date and time they are expected to run.
Dec 26 '19 #8
cactusdata
214 Expert 128KB
OK. Then please mark as answered.
Dec 26 '19 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Num | last post by:
Hi all, I have to convert a J2EE date as a long ("Millis") in a .NET date as a long ("Ticks") In Java, currentTimeMillis, is the difference, measured in milliseconds, between the current time...
7
by: Nimmy | last post by:
Hi, I have a file which has different dates, I want to scanf them as CHAR and convert them to DATE format, how can I do this? Thanks
0
by: stevag | last post by:
I want to convert a custom date format of the type DD/MM/YYYY into the RFC 822 date format in order to use it for RSS feeds. I want to do this transformation into an XSLT transformation which is...
2
by: TofuTheGreat | last post by:
I'm using "Now.ToOADate" for a record timestamp in a small database app (it's what I want to do so don't try to disuade me ;-D). Anyway. I store the value of Now.ToOADate in a string field in...
1
by: jimmybaba | last post by:
hi all i am newly graduate and started my first job.......i am geting problem to convert datetime into date only , i am trying to get values from sqlserver table with comparison of date. i am using...
2
by: iffizin | last post by:
how to convert character to date. writetime is character data type. i want to have CPU utilization of last 24 hrs. for time being i want to have result from 1 server. select...
5
by: Artie | last post by:
Hi, I have a date field stored as an INT and need to convert to a date format mm/dd/yyyy. I'm having trouble determining what the starting date is. min(date) = 730395 max(date) = 733189 ...
6
by: nady | last post by:
Hi, I have a database in mysql i have column which is text and i need to convert it to date for query purposes. the format for the string in the column is dd/mm/yyyy i need to convert this to...
5
satiss7pwr
by: satiss7pwr | last post by:
I have a string date like this: "3/28/2008 12:05:45 pm" i want to convert it into date and display the out put any one can help me plssssssssss
6
by: jdusn1978 | last post by:
Goal: Convert text to date in a query and show only dates that are older than 60 days from Date() I’ve searched the site and nothing quite matches what I’m looking for, at least in a way I can...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.