Click here to Skip to main content
15,887,585 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Thank you for resolving errors from programmers here.

I want to display the Hijri date with the Gregorian date in the label.

What I have tried:

VB
Private Sub Page_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        If Page.IsPostBack = False Then
            BINDSEC()
            Textbox1.Text = Request.QueryString("prompt0")
            RDate = CDate(Request.QueryString("prompt1"))
            CCDate = CDate(Request.QueryString("prompt2"))
            d3 = Request.QueryString("prompt3")
            d4 = Request.QueryString("prompt4")
            '  d5 = 1

        End If
        Execute()

    End Sub
Posted
Updated 3-Nov-23 3:17am
v2

1 solution

Check this out: Is it possible to convert Gregorian to Hijri date in Vb?[^]

VB.NET
Dim d As DateTime = DateTime.Today

Dim gc As GregorianCalendar = New GregorianCalendar()
Dim hc As HijriCalendar = New HijriCalendar()

Dim dg = New DateTime(d.Year, d.Month, d.Day, gc)
Dim dh = New DateTime(d.Year, d.Month, d.Day, hc)

Console.WriteLine($"Gregorian date: {dg.ToString("dd MMMM yyyy")} => Hijri date: {dh.ToString("dd MMMM yyyy")}")


More at:
HijriCalendar Class (System.Globalization) | Microsoft Learn[^]
DateTime Constructor (System) | Microsoft Learn[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900