Jump to content
geforce

função data e hora

Recommended Posts

geforce

Boas pessoal!

alguém me pode arranjar uma função que devolva a data e a hora actual?

Abraço

Share this post


Link to post
Share on other sites
IceBrain

Windows ou Linux/Unix?

Windows: GetLocalTIme

Linux/UNIX: time() para obter o tempo em segundos desde o Epoch e localtime() para converter isso numa estrutura com ano, mês, dia, hora, segundo, etc.


❝The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.❞- John Carmack on software patents

A list  of command line apps

Share this post


Link to post
Share on other sites
geforce

Linux.

obrigado:)

e para por numa variavel de uma estrutura para inserir numa lista de dados em C.

Share this post


Link to post
Share on other sites
IceBrain

Não percebi, podes dar um exemplo ou assim?


❝The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.❞- John Carmack on software patents

A list  of command line apps

Share this post


Link to post
Share on other sites
bubulindo

O título desta thread lembra-me uma tira do Dilbert em que ele chega ao escritório, senta-se, liga o computador e pensa:

"First business of the day, delete all emails with the word urgent in them."


include <ai se te avio>

Mãe () {

}

Share this post


Link to post
Share on other sites
geforce

o que eu quero e introduzir a data e a hora automaticamente dentro de uma variável do tipo de dados struct.

Share this post


Link to post
Share on other sites
bubulindo

Mas o google é muito lento e o assunto era urgente... LOLOL  :cheesygrin:


include <ai se te avio>

Mãe () {

}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.