473,554 Members | 3,199 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Date Conversion Hijri to Gregorian

Dear Respected Gurus,

I need a coding assistant converting from gregorian to hijri and vice
versa. I have problem with this codes. the problem Gregorian to Hijri
gives 100% results. when i enter this to Hijri to gregorian it either
do nothing or go to next record on form. well there r two fields on
form that r calc afterevents each other dates.

ur assistance will be highly appreciated, if any one can tell what is
wrong with this codes

Function strHijri(dtGreg orian As Date) As String
' returns a date in Hijri format for a given western date
VBA.Calendar = vbCalHijri
strHijri = Day(dtGregorian ) & "/" _
& Month(dtGregori an) & "/" _
& Year(dtGregoria n)
VBA.Calendar = vbCalGreg
End Function

Function strGregorian(dt Hijri As String) As String
' returns a date in Hijri format for a given western date
VBA.Calendar = vbCalGreg
strGregorian = Day(dtHijri) & "/" _
& Month(dtHijri) & "/" _
& Year(dtHijri)
VBA.Calendar = vbCalHijri

End Function

Nov 13 '05 #1
5 16077

SalimShahzad wrote:
Dear Respected Gurus,

I need a coding assistant converting from gregorian to hijri and vice
versa. I have problem with this codes. the problem Gregorian to Hijri
gives 100% results. when i enter this to Hijri to gregorian it either
do nothing or go to next record on form. well there r two fields on
form that r calc afterevents each other dates.

ur assistance will be highly appreciated, if any one can tell what is
wrong with this codes

Function strHijri(dtGreg orian As Date) As String
' returns a date in Hijri format for a given western date
VBA.Calendar = vbCalHijri
strHijri = Day(dtGregorian ) & "/" _
& Month(dtGregori an) & "/" _
& Year(dtGregoria n)
VBA.Calendar = vbCalGreg
End Function

Function strGregorian(dt Hijri As String) As String
' returns a date in Hijri format for a given western date
VBA.Calendar = vbCalGreg
strGregorian = Day(dtHijri) & "/" _
& Month(dtHijri) & "/" _
& Year(dtHijri)
VBA.Calendar = vbCalHijri

End Function


Did you check MichKa's site? www.trigeminal.com? He's the resident
internationaliz ation guru...

Nov 13 '05 #2
<pi********@hot mail.com> wrote in message
news:11******** *************@c 13g2000cwb.goog legroups.com...

SalimShahzad wrote:
Dear Respected Gurus,

I need a coding assistant converting from gregorian to hijri and vice
versa. I have problem with this codes. the problem Gregorian to Hijri
gives 100% results. when i enter this to Hijri to gregorian it either
do nothing or go to next record on form. well there r two fields on
form that r calc afterevents each other dates.

ur assistance will be highly appreciated, if any one can tell what is
wrong with this codes

Function strHijri(dtGreg orian As Date) As String
' returns a date in Hijri format for a given western date
VBA.Calendar = vbCalHijri
strHijri = Day(dtGregorian ) & "/" _
& Month(dtGregori an) & "/" _
& Year(dtGregoria n)
VBA.Calendar = vbCalGreg
End Function

Function strGregorian(dt Hijri As String) As String
' returns a date in Hijri format for a given western date
VBA.Calendar = vbCalGreg
strGregorian = Day(dtHijri) & "/" _
& Month(dtHijri) & "/" _
& Year(dtHijri)
VBA.Calendar = vbCalHijri

End Function


Did you check MichKa's site? www.trigeminal.com? He's the resident
internationaliz ation guru...


He's got code to convert back and forth between Hijri and Gregorian at
http://www.trigeminal.com/codes.asp?ItemID=14#14

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

Nov 13 '05 #3
See?!! I knew it was there! Makes me think I'd be better as a
librarian than a programmer!

Nov 13 '05 #4
Dear Gurus,

There is problem in passing date as string, can any one send reference
of codes will help a bit for me. as in text box, table field has set as
date.

when i call as msgbox under "1/1/2005" or "1/1/1426" it gives 100%
results, but when i used via text box value putting it gives unexpected
dates or results

i had try following

MsgBox StDteHijriOfStD teGreg("'" & Dt_Dob_en.Value & "'")
MsgBox StDteHijriOfStD teGreg( Dt_Dob_en.Value )
MsgBox StDteHijriOfStD teGreg(cstr(Dt_ Dob_en.Value))

even i define as string variable and pass value to this and then try
but the results is same...

can any one help me how to pass date as string to function in modules
thanks and rgds
shahzad

Nov 13 '05 #5

SalimShahzad wrote:
Dear Gurus,

There is problem in passing date as string, can any one send reference of codes will help a bit for me. as in text box, table field has set as date.

when i call as msgbox under "1/1/2005" or "1/1/1426" it gives 100%
results, but when i used via text box value putting it gives unexpected dates or results

i had try following

MsgBox StDteHijriOfStD teGreg("'" & Dt_Dob_en.Value & "'")
MsgBox StDteHijriOfStD teGreg( Dt_Dob_en.Value )
MsgBox StDteHijriOfStD teGreg(cstr(Dt_ Dob_en.Value))

even i define as string variable and pass value to this and then try
but the results is same...

can any one help me how to pass date as string to function in modules
thanks and rgds
shahzad

You REALLY need to make friends with the helpfile. REALLY. How about
using something like oh, I dunno... CDATE() or DATESERIAL or one of
those other handy dandy conversion/date functions. Or shock of shocks,
pass the stupid thing as a DATE, not a text string.

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2174
by: nimish | last post by:
I have Month, Day and Year fields on my form. When I submit this form I want to create a valid date from all three fields before inserting into MYSQL table. I tried following: $dob=$Month."-".$Day."-".$Year; $dob = strtotime($dob); But it does not update my date field in the table. I am novice in PHP, do you know where i am making a mistake.
9
1766
by: Se'noj | last post by:
Hi all, In a program I am writing, I need to convert a date stored as an integer number of days into a standard gregorian format, with day zero being 1/1/1800. Can anyone help me with this? Bryan Jones NightDaemon Enterprises nightdaemon.co.nr
3
5631
by: Chris Davoli | last post by:
Is there a class that converts from Gregorian date to TRUE Julian Date in ..NET? Any VB.NET examples available? ie; The Julian date is calculated by the number of days since January 1, 4713 BC. For example, the Julian date for August 1, 2001 is 2452122. -- Chris Davoli
1
1632
by: Franck | last post by:
Hi, 'm gettin mad about date conversion. Here is the point. Got and add-in for Excel which call functions from a web service (on a remote server) The remote server has regional settings set to "en-UK" and date to dd/MM/yyyy. (I'can't change it !)
1
3223
by: vadala | last post by:
The requirement is to send start data and end date from java to UI (.net) for a functionality. We are setting the time in java (1.5) before handing it over to WebService (sending to UI ) in "ASIA/KUALA_LUMPUR" (MYT) TIMEZONE. OS WIN-XP Strangely UI receives a different date. java side UI side
7
3000
by: bruce.dodds | last post by:
Access seems to be handling a date string conversion inconsistently in an append query. The query converts a YYYYMM string into a date, using the following function: CDate(Right(,2) & "/1/" & Left(,4)) I entered the string "200715" in a record to test an error condition.
2
5137
by: RN1 | last post by:
A TextBox displays the current date (in dd/mm/yyyy format) & time when a user comes to a page (e.g. 15/10/2008 1:36:39 PM). To convert the date into international format so that the remote server doesn't generate any error, this is what I am doing: --------------------------- Dim strSDate As String Dim strSTime As String Dim strStartDT As...
2
2117
by: anderst | last post by:
Hi! I need help with date conversion, I need a perl-script that transform Wed Mar 28 00:00:00 GMT+02:00 2007 to 2007-03-28 I have tried to use perl modules Date::Manip and Date::Calc, but no succes so far. Maybe I am doing it the wrong way.
4
2116
maheshwag
by: maheshwag | last post by:
my code is: string sql="insert into dummy(date)values(@date) sqlcommand cmd=new sqlcommand(sql,con) cmd.parameters.Add("@date", SqlDbtype.datetime).values=maskedtextbox1.text; cmd.ExecuteNonquery();
0
7583
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7507
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8019
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7542
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6127
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5424
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1115
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.