Farsi Components

   Home  |   Products  |   Download  |   Order  |   Support  |   Contact

  فارسی  

Products:

ShDate Solutions
ShDate Utils
ShDate Fields
ShDatePicker
DBShDatePicker
ExShDatePicker
DBExShDatePicker
ShMonthCalendar

TFCImage


Freeware:
TBdDBNavigator
TDragListBox


Get Firefox!
Products  >  ShDate Solutions

ShDateUtils

Basic date routines for Hijri Shamsi calendar (Jalali)

ShDateUtils provides support for Hijri Shamsi date in Delphi. Using routines of this unit you will be able to store Hijri Shamsi date-time values in TDateTime type, display them, or allow edits on them, or simply do calculations over them.

This unit provides feasibility of using TDateTime type with Hijri Shamsi date through implementing fundamental functions for encoding a Hijri Shamsi date in a TDateTime value and decoding it, with accurate calendrical calculations.
Then, with providing TDateTime to string conversion functions makes it possible to display dates as Hijri Shamsi custom formats. Through string to TDateTime conversion functions it supports converting Hijri Shamsi date-time values entered by user, or available as string, to TDateTime type. You will not need to check validity of value entered by user; this will be done within these functions and an exception will be raised in case of errors.

Using this method functions for date conversion between calendars will not be required and having date in one of the calendars you encode it in TDateTime and with value as TDateTime you can decode or convert it to string in any calendars.

Main Usages:

  • Provide possibility of using TDateTime type with Hijri Shamsi dates.
  • Support processes related to Hijri Shamsi date and date-time values.
  • This unit is the base for all components in ShDate Solutions package.

Highlights:

  • RAD in applications containing Hijri Shamsi date-time values.
  • Use standard data types for storing date/date-time values.
  • Very accurate calendrical calculations.

Features:

  • Feasibility of utilizing TDateTime with Hijri Shamsi date.
  • Completely standard and compatible with date-time routines available in Delphi.
  • Display date-time values with custom formats with ease.
  • No validity checks are required for entered date or date-time values.

Routines:

  • Encode Hijri Shamsi year-month-day into TDateTime.
  • Decode TDateTime to Hijri Shamsi year-month-day.
  • Convert TDateTime to string - with custom formats - for displaying purposes.
  • Convert date-time values from String to TDateTime intelligently and do validity checks.
  • Calculations of week numbers.
  • + Some other utility functions.

Some Examples:

Label1.Caption := ShDateToStr(Date); //Show today
ShDateTimeToStr(Now); //Show current date and time
ShFormatDateTime(MyFormat, MyDate); //Show formatted date
MyDate := ShStrToDate(Edit1.Text); //Get date
MyDate := MyDate + 15; //15 days later


To top of page
   © Copyright 2001-2008 Amir Rahimi Farahani. All rights reserved.