# Playing with Arabic date

First of all, you have to get a request as a native character (e.g.: ١٩.٠٥.٢٠٢٣)

URL : [http://localhost/test.aspx?date=](http://localhost/test.aspx?date=%D9%A1%D9%A9.%D9%A0%D9%A5.%D9%A2%D9%A0%D9%A2%D9%A3)١٩.٠٥.٢٠٢٣

```csharp
public static string GetQueryStringValueFromRawUrl(string queryStringKey)
{
    var currentUri = new Uri(HttpContext.Current.Request.Url.Scheme + "://" +
        HttpContext.Current.Request.Url.Authority +
        HttpContext.Current.Request.RawUrl);
    var queryStringCollection = HttpUtility.ParseQueryString((currentUri).Query);
    return queryStringCollection.Get(queryStringKey);
}
```

Second, get the int value of each item;

```csharp
public static DateTime ArabicDate(string str)
{
    string[] teslim = str.Split('.');
    return new DateTime(getIntofArabicValue(teslim[2]), getIntofArabicValue(teslim[1]), getIntofArabicValue(teslim[0]));
}

static int getIntofArabicValue(string str)
{
    return Int32.Parse(string.Join("", str.Select(c => char.GetNumericValue(c))));
}
```

Then you can call the function;

```csharp
PublicFunctions.ArabicDate(PublicFunctions.GetQueryStringValueFromRawUrl("date").Replace("'", ""));
```
