Coder Social home page Coder Social logo

ozone's Introduction

ozone

Python script for converting date and time using my favorite thing: regex

Like anything else I shared, it's in perpetual development. You can play with the broken version here.

About and Usage

from Ozone import Ozone

Ozone.ozonize("20.04.2020 16:00 CET GMT")

The insides are held together by duct tape, but if you feed it a string in a format of:

DATE TIME (TIME_END) TIMEZONE_INPUT TIMEZONE_OUTPUT ($FORMAT)

It will convert the date and time, from and to the timezones provided and return a tuple with strings:

DATE TIME TIMEZONE_OUTPUT

And optional:

DATE TIME_END TIMEZONE_OUTPUT

Format is optional, and if nothing is passed default is being used:

dd.mm.yyyy HH:MM (HH:MM) # 20.04.2020 16:20

If you are using dates in different formats, you can pass the custom format at the end using $, and separating every item with a $

Available formats:

  • $mdy

    04.20.2020
    
  • $ymd

    2020.04.20
    
  • $ydm

    2020.20.04
    
  • $Mdy

    Apr 20, 2020
    
  • $12

    04:00 PM
    
  • $24

    16:00
    

ozone's People

Contributors

kaysersoze42 avatar

Watchers

 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.