Download the PHP package phannaly/php-datetime-khmer without Composer

On this page you can find all versions of the php package phannaly/php-datetime-khmer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-datetime-khmer

The PHP libray for convert datetime into Khmer

Actions Status License: MIT

This is a small package for converting datetime to Khmer language.

Requirements

Setup

You don't need to install by composer if your project doesn't have it.

Just import it manually in src folder.

But If you want to install by a composer, please follow the command below

composer require phannaly/php-datetime-khmer

Usage

Whenever you want to convert any DateTime into Khmer language, just wrap it inside method.

Firstly, you can import or instance class

You have to parse a valid string DateTime format and without a specific time, it will set time to 00:00

For example:

will producing result below

Code Format Output
$dateTime->format("L") L ២០/០៩/២០២០
$dateTime->format("LL") LL ២០ កញ្ញា ២០២០
$dateTime->format("LLT") LLT ២០ កញ្ញា ២០២០ ១២:៤០ ល្ងាច
$dateTime->format("LLL") LLL អាទិត្យ ២០ កញ្ញា ២០២០
$dateTime->format("LLLT") LLLT អាទិត្យ ២០ កញ្ញា ២០២០ ១២:៤០ ល្ងាច
$dateTime->format("LLLLT") LLLL ថ្ងៃអាទិត្យ ទី២០ ខែកញ្ញា ឆ្នាំ២០២០
$dateTime->format("LLLLT") LLLLT ថ្ងៃអាទិត្យ ទី២០ ខែកញ្ញា ឆ្នាំ២០២០ ១២:៤០ ល្ងាច

If you wanna use DateTime duration in Khmer, you can use fromNow() method that checks the date that you parse compare with your current timestamp. The default fromNow method will add space between duration, if you want to remove space just add fromNow(false) Ex:

Below is the example how fromNow() method works

Code Current timestamp Output
KhmerDateTime::parse('2012-10-20')->fromNow() 2020-09-20 ៧ ឆ្នាំមុន
KhmerDateTime::parse('2020-03-20')->fromNow() 2020-09-20 ៦ ខែមុន
KhmerDateTime::parse('2020-09-15')->fromNow() 2020-09-20 ៥ ថ្ងៃមុន
KhmerDateTime::parse('2020-09-15 02:00')->fromNow() 2020-09-15 06:00 ៤ ម៉ោងមុន
KhmerDateTime::parse('2020-09-15 06:00')->fromNow() 2020-09-15 06:03 ៣ នាទីមុន

If you parse the timestamp in the future

Code Current timestamp Output
KhmerDateTime::parse('2027-10-20')->fromNow() 2020-09-20 ៧ ឆ្នាំទៀត
KhmerDateTime::parse('2021-03-20')->fromNow() 2020-09-20 ៦ ខែទៀត
KhmerDateTime::parse('2020-09-25')->fromNow() 2020-09-20 ៥ ថ្ងៃទៀត
KhmerDateTime::parse('2020-09-15 10:00')->fromNow() 2020-09-15 06:00 ៤ ម៉ោងទៀត
KhmerDateTime::parse('2020-09-15 06:03')->fromNow() 2020-09-15 06:00 ៣ នាទីទៀត

Using the current timestamp without specific date and time

`

Contributing

Feel free to contribute through PR.

License

This package operates under the MIT License (MIT). See the LICENSE file for details.


All versions of php-datetime-khmer with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phannaly/php-datetime-khmer contains the following files

Loading the files please wait ....