1aae said:
International Question:
=Format(Now();"yyyy")
previous code display code current year like 2004 ( can any one tell
me) how to change code to Hijri Date like 1425
What Is The Function need to convert to Hijri date
Thank you
You can set the Hijri Calendar option for your database as a whole from
the International tab of the Tools -> Options... dialog. If you want to
do a quick conversion of a date value to the Hijri calendar, it's
another matter. I don't know anything about internationalization, and I
don't know if this has any bad side effects, but from my reading it
seems you could do something like this:
'----- start of untested function -----
Function HijriFormat( _
FormatString As String, _
Optional GivenDate As Date = Date()) _
As String
On Error GoTo Err_Handler
Calendar = vbCalHijri
HijriFormat = Format(GivenDate, FormatString)
Exit_Point:
Calendar = vbCalGreg
Exit Function
Err_Handler:
MsgBox Err.Description, vbExclamation, "Error " & Err.Number
Resume Exit_Point
End Function
'----- end of function -----
Then you would call it like this:
=HijriFormat("yyyy")
or
strHijriDate = HijriFormat("mm/dd/yyyy", [DateField])
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)