Giter Club home page Giter Club logo

Tema 2 - Unix Timestamp

Pentru task-urile 2-5 vom folosi un vector in care vom salva numarul de zile din fiecare luna
Urmand ca la task-ul 6 sa folosim un vector asemanator de tip char, in care vom stoca numele fiecarui luni din an

Task 1

  • Impartim timestamp-ul primit ca parametru la numarul de secunde dintr o ora, respectiv la numarul de minute dintr-o ora
  • Valoarea ramasa in timestamp reprezinta numarul de secunde
  • Se returneaza rezultatul sub forma [ ora , minute, secunde ]

Task 2

  • Calculam intai anul, asemanator ca in taskul anterior
  • Apoi scadem din timestamp numarul de secunde intr-o zi inmultite cu numarul de zile de pe pozitia respectiva, folosind vectorul de zile
  • Ulterior pentru a afla ziua din data, impartim timestamp-ul la secundele dintr-o zi

Task 3

  • Asemantor algoritmului de la taskului anterior, vom calcula data din timestamp, tinand cont de existenta anilor bisecti

Task 4

  • In plus, fata de taskul 3, vom calcula si ora exacta aferenta timestamp-ului (asemanator ca in taskul 1)

Task 5

  • La acest task, facem procedeul invers fata de taskul aneterior, tinand cont de anii bisecti si actualizand vectorul cu zilele din an, in functie de valoarea anului
  • Vom avea nevoie de 2 for-uri, unul pentru a aduna secundele din fiecare an complet pana la cel dat si unul pentru a aduna secundele din toate lunile complete pana la cea data, urmand sa adunam si zilele, orele, minutele, secundele, scazand in final diferenta de fus orar

Task 6

  • Vom afisa data si ora in formatul cerut, tinand cont de padding

raress04's Projects

unikraft icon unikraft

Unikraft is an automated system for building specialized OSes known as unikernels. Unikraft can be configured to be POSIX-compliant. (Core repository)

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.