Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

433
Views
¿Cómo convertir la fecha gregoriana a la fecha persa?

Quiero convertir una fecha gregoriana personalizada a una fecha persa en C#. Por ejemplo, tengo una cadena con este contenido:

 string GregorianDate = "Thursday, October 24, 2013";

Ahora quiero tener:

cadena PersianDate = پنج‌شنبه 2 آبان 1392 ;

o

cadena PersianDate = 1392/08/02

Gracias

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Utilice el calendario persa:

 string GregorianDate = "Thursday, October 24, 2013"; DateTime d = DateTime.Parse(GregorianDate); PersianCalendar pc = new PersianCalendar(); Console.WriteLine(string.Format("{0}/{1}/{2}", pc.GetYear(d), pc.GetMonth(d), pc.GetDayOfMonth(d)));
over 4 years ago · Santiago Trujillo Report

0

Puedes usar PersianDateTime:

 PM> Install-Package PersianDateTime

La referencia: PersianDateTime

Puede usar string.Split() si necesita personalización.

over 4 years ago · Santiago Trujillo Report

0

 DateTime date = new DateTime(2013, 10, 24); var calendar = new PersianCalendar(); var persianDate = new DateTime(calendar.GetYear(date), calendar.GetMonth(date), calendar.GetDayOfMonth(date)); var result = persianDate.ToString("yyyy MMM ddd", CultureInfo.GetCultureInfo("fa-Ir"));
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!