Skip to content

Igao2/date-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This api is made for data diferences consults. justs that. really

Endpoints

/diferencadatas


Needs three arguments, with two optionals arguments h1 and h2
  • datai: The initial data, in format dd/mm/yyyy

  • dataf: The final data, in format dd/mm/yyyy

  • h1: The initial hour, in the format HH:mm(optional)

  • h2: The final hour, in the format HH:mm(optional)

  • format: The format you want the return of JSON. There are many formats:

    • YMdhm: returns a json contains the fields results for years,months,days,hours and minutes

    • dhm: return the diference in days,hours and minutes

    • YMd: returns the diference in years, months and the days

    • dhm: return the diference in days,hours and minutes

    • dh: return the diference in days and hours

    • dm: return the diference in days and minutes

    • hm: return the diference in days,hours and minutes

    • Y: returns just the years diference

    • M: returns just the months diference

    • d: returns just the days diference

    • h: returns just the hours diference

    • m: returns just the minutes diference


Examples


Example 1


In this example, we're using the query "?datai=22/03/2022&h1=22:10&dataf=22/04/2024&format=YMdhm"



This return the diference between the date 22/03/2022 22:10 and 22/04/2024 00:00(observe that hours can be ignored, and the api will assume that you put 00:00) in years,months,days, hours and minutes.

Example 2




Anoter example, this time utilizing "format=dhm" and the same dates

About

api to calculate diference between dates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published