[R-sig-Epi] Converting dates from the Persian calendar to Gregorian

BXC (Bendix Carstensen) bxc at steno.dk
Wed Jan 7 13:26:04 CET 2009

Hi Amy,
you probaly already have visited:
where the Iranian guy Homam Hosseini provides a discussion of the conversion, and some C code to do it.

I am a C ignorant, but surely someone in the R-community would be able to take this code (and in collaboration with Homam) provide a function that converts Iranian / Jalali dataes to and from the Gregorian Date class??

Best regards

> -----Original Message-----
> From: r-sig-epi-bounces at stat.math.ethz.ch 
> [mailto:r-sig-epi-bounces at stat.math.ethz.ch] On Behalf Of Amy Mikhail
> Sent: 7. januar 2009 12:40
> To: r-sig-epi at stat.math.ethz.ch
> Subject: [R-sig-Epi] Converting dates from the Persian 
> calendar to Gregorian
> Dear Epi list,
> This is not a strictly epidemiological question, but an issue 
> that anyone might face if presented with a dataset containing 
> dates in a non-gregorian format.
> I am currently developing a database (in MS Access) for a 
> public health study, the results of which I intend to analyse 
> in R.  I have a small problem, in that the date each patient 
> visits the clinic will be entered into the database in the 
> Persian  / Jalali calendar format - e.g. today's
> date in the Persian calendar is 18.10.1387.   For the 
> analysis however I
> need these dates to be converted to Gregorian, so that I can 
> have months on the x axis of plots, etc.
> Does anyone know of a function / some code already written 
> that could do this conversion in R?  It is much too complex 
> for me to figure out (since the Persian new year starts on 
> 21st March, and although there are also 12 months they have 
> different lengths to gregorian months).  I'm guessing it 
> would require loops and such but this is beyond my current 
> level of R knowledge.
> I have found some online tools that do the conversion of 
> individual dates, but there seems to be nothing out there 
> that would convert a whole dataset's worth of dates.
> Any suggestions much appreciated,
> With best wishes,
> Amy
> --
> Amy Mikhail
> Program Manager, ACTc Afghanistan Malaria Project London 
> School of Hygiene & Tropical Medicine HPRO, Charahi-e-Shahid, 
> Shar-e-Naw, Kabul, Afghanistan
> Email (Afg): amy.mikhail at googlemail.com
> Email (UK): Amy.Mikhail at lshtm.ac.uk
> Tel (Afg): +93 (0)706 126627
> Tel (UK): +44 (0)781 4176107
> 	[[alternative HTML version deleted]]
> _______________________________________________
> R-sig-Epi at stat.math.ethz.ch mailing list 
> https://stat.ethz.ch/mailman/listinfo/r-sig-epi

More information about the R-sig-Epi mailing list