Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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 ;-)
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

609 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