Coldfusion  working with Julian dates

Posted on 2010-09-14
Medium Priority
Last Modified: 2012-06-27
I want to get yesterdays Julian date. I thought I could just add "-1" to the below code but it doesn't work. can someone show me the correct way to get yesterdays julian date? thanks!

<cfparam name = "dayOfYear" default="#NumberFormat(DayOfYear(Now()),"000")#" >
Question by:Bang-O-Matic
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
LVL 52

Accepted Solution

_agx_ earned 2000 total points
ID: 33675056
I've never done it myself. But it doesn't seem as simple as that.  I'd check cflib.org. If you search on "Julian" they've got a couple functions like


Author Comment

ID: 33676600
Still stuck... anyone else?
LVL 52

Expert Comment

ID: 33677485
>> Still stuck... anyone else?

Well .. if you want anyone else to help, I think you'll have to describe what results you're getting _now_ and how they're different from the desired you want ;-)
A new era in Cloud training has arrived.

A day that will go down in Cloud history.. But are you ready for it? Will you accept this Cloud challenge?


Author Comment

ID: 33677728
I think I have it working:

<cfparam name = "julianday" default="#NumberFormat(DayOfYear(Now()))#">
<cfset Yesterday = #julianday# - 1>

The problem is I have to download new photozips daily and the file names are julian dates like "photozip_257.zip" but the newest file is always dated from the prior day...if that makes sense.

Author Comment

ID: 33677738
Lol, point well taken agx, I didnt properly describe the issue.
LVL 52

Expert Comment

ID: 33677929
No problem :)  I just wanted to make sure you got a good response.  But I'm glad to hear you figured it out yourself.

Author Closing Comment

ID: 33677968
Thanks for the help!
LVL 52

Expert Comment

ID: 33678578
Hmm.. you may want to add special handling for the 1st day of the year. Otherwise #Yesterday# will end up being "0" on January 1st.

<cfparam name = "julianday" default="#DayOfYear(Now())#">
<cfif julianDay eq 1>
      <cfset julianDay = DayOfYear(dateAdd("d", -1, now()))>
<cfset Yesterday = julianDay - 1>

Author Comment

ID: 33678927
right you are! thanks again agx.

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question