Coder Social home page Coder Social logo

philcook / dot-net-json-date-formatter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from webapix/dot-net-json-date-formatter

0.0 2.0 0.0 9 KB

Parse .Net JSON dates to DateTime object, and convert DateTime object to .Net JSON date format.

License: MIT License

PHP 100.00%

dot-net-json-date-formatter's Introduction

Dotnet JSON date

Tests MIT Licensed

Parse .Net JSON dates to DateTime object, and convert DateTime object to .Net JSON date format.

Installation

You can install the package via composer:

composer require webapix/dot-net-json-date-formatter

Usage

To parse .NET JSON dates:

use \Webapix\DotNetJsonDate\Date;

Date::toDateTime('/Date(1593432000000+0200)/'); // return with \DateTime object

If the Json string is invalid, it will throw an \Webapix\DotNetJsonDate\InvalidJsonDateString exception.

To convert DateTime to JSON date:

use \Webapix\DotNetJsonDate\Date;

$dateTime = DateTime::createFromFormat('Y-m-d H:i:s', '2020-06-29 12:00:00');
Date::toJsonDate($dateTime); // return with: /Date(1593432000000+0000)/

Testing

composer test

Postcardware

According to the postcardware concept, if you use the software for your project(s) we would appreciate to receive a postcard of your hometown.

Please send it to:

WEBAPIX KFT.
Hűvösvölgyi út 54. 2.ép 3.emelet
1021 Budapest
Hungary

Support us

If you find our packages useful and would like to support our work in maintaining and regularly updating them, consider becoming a patron. Any size of donation is welcome and highly appreciated.

Contributing

Contributions are welcome! When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

dot-net-json-date-formatter's People

Contributors

zsocakave avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.