Skip to content

A Mysql function to return a working time elapsed from two dates, giving the begin and the finish of work time.

License

Notifications You must be signed in to change notification settings

rafaelqm/Elapsed_Working-time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Elapsed working-time

A Mysql function to return a elapsed working-time from two dates, giving the begin and the finish of work time.

Run in the MySQL query browser a content of: feriados.sql

Run the content of: elapsed_working_hours.sql

Test: SELECT elapsed_working_hours('2012-12-21 06:00:00', '2012-12-21 19:00:00', '09:00:00', '18:00:00' ); // should result 9

/**

  • PT-BR */ Tempo de trabalho decorrido ===========================

Uma função em Mysql para calcular o tempo gasto entre duas datas, passando por parâmetro a hora inicial e final do período de trabalho.

Para colocar para funcionar rode no navegador de consultas o contedudo do arquivo: feriados.sql

Rode o conteúdo do arquivo: elapsed_working_hours.sql

Depois é só testar:

SELECT elapsed_working_hours('2012-12-21 06:00:00', '2012-12-21 19:00:00', '09:00:00', '18:00:00' ); // deverá retornar 9

Depois é só alterar os parâmetros assim como você necessitar.

About

A Mysql function to return a working time elapsed from two dates, giving the begin and the finish of work time.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published