473,473 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

convert hebrew calander date to grugorian calander date

1 New Member
i need to convert date of hebrew calander to grugorian;
how can i do it?

irena.
Feb 1 '20 #1
2 2540
cactusdata
214 Recognized Expert New Member
Why not use an API like this: Hebrew Date Converter REST API
Feb 2 '20 #2
SioSio
272 Contributor
Convert using HebrewCalendar and GregorianCalendar.
Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.IO;
  3. using System.Globalization;
  4.  
  5. private string SetHebrewDate(int yyyy, int mm, int dd)
  6. {
  7.             CultureInfo culture1 = new CultureInfo("he-IL", true);
  8.             Calendar HebrewCalendar = new HebrewCalendar();
  9.  
  10.             DateTime dt1;
  11.             // set Hebrew date
  12.             dt1 = HebrewCalendar.ToDateTime(yyyy, mm, dd, 0, 0, 0, 0, Calendar.CurrentEra);
  13.  
  14.             GregorianCalendar myGre = new GregorianCalendar();
  15.             CultureInfo culture2 = new CultureInfo("en-GB", true);
  16.             string y2 = myGre.GetYear(dt1).ToString("D4",culture2);
  17.             string m2 = myGre.GetMonth(dt1).ToString("D2",culture2);
  18.             string d2 = myGre.GetDayOfMonth(dt1).ToString("D2",culture2);
  19.             Return d2 + "/" + m2 + "/" + y2;
  20. }
  21.  
Feb 3 '20 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Num | last post by:
Hi all, I have to convert a J2EE date as a long ("Millis") in a .NET date as a long ("Ticks") In Java, currentTimeMillis, is the difference, measured in milliseconds, between the current time...
7
by: Nimmy | last post by:
Hi, I have a file which has different dates, I want to scanf them as CHAR and convert them to DATE format, how can I do this? Thanks
1
by: Sam | last post by:
How do I convert Julian Date to Calendar Date in ASP.Net 1.1 based on following guideline found at Internet? To convert Julian date to Gregorian date: double JD = 2299160.5; double Z =...
1
by: abcabcabc | last post by:
I write an application which can let user define own date format to input, How to convert the date string to date value with end-user defined date format? Example, User Defined Date Format as...
7
by: Richiep | last post by:
I am trying to get a UK format date of dd/mm/yyyy. Why does the following subroutine not return a valid date in a web form? The date returned is #12:00:00 AM# but the date I entered into the...
10
by: satishrajana | last post by:
Hi, My SQL returns a NULL in a datefield if there is no date in that field. If there is a NULL in this column, I want to replace it with spaces in my SELECT statement when I am selecting these...
4
by: Holmsey | last post by:
Hi I have to convert am today's date and time (now) to a webservice. The example the web service gives was "1163313527144#" which comes out to 12/31/1969 06:00 PM. How do I convert a date to a 13...
4
by: Nathan Sokalski | last post by:
When determining whether a String can be converted to a DateTime, you can use the IsDate() method. However, I would also like to know whether the string is a date, a time, or both a date and a...
5
by: Artie | last post by:
Hi, I have a date field stored as an INT and need to convert to a date format mm/dd/yyyy. I'm having trouble determining what the starting date is. min(date) = 730395 max(date) = 733189 ...
6
by: jdusn1978 | last post by:
Goal: Convert text to date in a query and show only dates that are older than 60 days from Date() I’ve searched the site and nothing quite matches what I’m looking for, at least in a way I can...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
1
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...
0
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,...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.