---
title: "Formatting Hebrew dates"
url: "https://osherove.com/blog/2004/9/13/formatting-hebrew-dates.md"
canonical: "https://osherove.com/blog/2004/9/13/formatting-hebrew-dates.html"
published: "2004-09-13T06:29:00"
updated: "2004-09-13T06:29:00"
tags: [".Net Quotations"]
author: "Roy Osherove"
description: "Based on the amount of articles out there relating to hebrew dating (and I don't mean a singles bar!) there's always confusion on how exactly to translate a date into its full hebrew representation. Here's a simple…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# Formatting Hebrew dates

By Roy Osherove September 13, 2004 In [.Net Quotations](https://osherove.com/blog/category/net-quotations)

**Historical article** · Originally published September 13, 2004; technical details may be outdated.

Based on the amount of articles out there relating to hebrew dating (and I don't mean a singles bar!) there's always confusion on how exactly to translate a date into its full hebrew representation. Here's a simple method that does this, based on information which is easily available via [this article](http://msdn.microsoft.com/library/en-us/cpguide/html/cpconworkingwithcalendars.asp).

---

C#

/// <summary>
  /// Returns the Juwish formatted date
  /// </summary>
  /// <param name="anyDate">Any valid date</param>
  /// <param name="addDayOfWeek">Set this option to add the day of the week to the formatted date</param>
  /// <returns>A string containing the Juwish formatted date</returns>
  public static string GetHebrewJuwishDateString(DateTime anyDate, bool addDayOfWeek)
  {
   System.Text.StringBuilder hebrewFormatedString = new System.Text.StringBuilder();
   
   // Create the hebrew culture to use hebrew (Juwish) calendar
   CultureInfo juwishCulture = CultureInfo.CreateSpecificCulture("he-IL");
   juwishCulture.DateTimeFormat.Calendar = new HebrewCalendar();
 
   #region Format the date into a Juwish format

   if (addDayOfWeek)
   {
    // Day of the week in the format " "
    hebrewFormatedString.Append(anyDate.ToString("dddd", juwishCulture) + " ");
   }

   // Day of the month in the format "'"
   hebrewFormatedString.Append(anyDate.ToString("dd", juwishCulture) + " ");

   // Month and year in the format " "
   hebrewFormatedString.Append("" + anyDate.ToString("y", juwishCulture));

   #endregion

   return hebrewFormatedString.ToString();

  }

---

VB.NET

''' <summary>
    ''' Summary description for JewishDateHelper.
    ''' This Class holds a single method that returns the Hebrew Jewish date format.
    ''' </summary>
    Public Class JewishDateHelper

        ''' <summary>
        ''' Returns the Juwish formatted date
        ''' </summary>
        ''' <param name="anyDate">Any valid date</param>
        ''' <param name="addDayOfWeek">Set this option to add the day of the week to the formatted date</param>
        ''' <returns>A string containing the Juwish formatted date</returns>
        Public Shared Function GetHebrewJuwishDateString(ByVal anyDate As DateTime, ByVal addDayOfWeek As Boolean) As String
            Dim hebrewFormatedString As System.Text.StringBuilder = New System.Text.StringBuilder

            '' Create the hebrew culture to use hebrew (Juwish) calendar
            Dim juwishCulture As CultureInfo = CultureInfo.CreateSpecificCulture("he-IL")
            juwishCulture.DateTimeFormat.Calendar = New HebrewCalendar

            If (addDayOfWeek) Then
                '' Day of the week in the format " "
                hebrewFormatedString.Append(anyDate.ToString("dddd", juwishCulture) + " ")
            End If

            '' Day of the month in the format "'"
            hebrewFormatedString.Append(anyDate.ToString("dd", juwishCulture) + " ")

            '' Month and year in the format " "
            hebrewFormatedString.Append("" + anyDate.ToString("y", juwishCulture))

            Return hebrewFormatedString.ToString()

        End Function

Thanks, Ido!

## More in .Net Quotations

[All posts in .Net Quotations](https://osherove.com/blog/category/net-quotations)

- Sep 21, 2004

    ### [MbUnit 2.21.1.0 RC1 released (and some nifty nifty features!)](https://osherove.com/blog/2004/9/21/mbunit-22110-rc1-released-and-some-nifty-nifty-features.html)

- Sep 19, 2004

    ### [Alik Levin has a blog - with short Hebrew movies on various ASP.Net topics](https://osherove.com/blog/2004/9/19/alik-levin-has-a-blog-with-short-hebrew-movies-on-various-as.html)

- Sep 11, 2004

    ### [Organization Patterns of Agile Software Development](https://osherove.com/blog/2004/9/11/organization-patterns-of-agile-software-development.html)

- Sep 7, 2004

    ### [Implementing CollectionBase the right way](https://osherove.com/blog/2004/9/7/implementing-collectionbase-the-right-way.html)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
