geforce Posted December 25, 2010 at 10:44 PM Report #360150 Posted December 25, 2010 at 10:44 PM Boas pessoal! alguém me pode arranjar uma função que devolva a data e a hora actual? Abraço
IceBrain Posted December 26, 2010 at 12:04 AM Report #360159 Posted December 26, 2010 at 12:04 AM 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
geforce Posted December 26, 2010 at 12:41 AM Author Report #360163 Posted December 26, 2010 at 12:41 AM Linux. obrigado:) e para por numa variavel de uma estrutura para inserir numa lista de dados em C.
IceBrain Posted December 26, 2010 at 01:45 AM Report #360167 Posted December 26, 2010 at 01:45 AM 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
bubulindo Posted December 26, 2010 at 12:07 PM Report #360179 Posted December 26, 2010 at 12:07 PM 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 () { }
geforce Posted December 26, 2010 at 03:54 PM Author Report #360195 Posted December 26, 2010 at 03:54 PM o que eu quero e introduzir a data e a hora automaticamente dentro de uma variável do tipo de dados struct.
bubulindo Posted December 27, 2010 at 12:45 AM Report #360228 Posted December 27, 2010 at 12:45 AM Se tivesses lido o que está neste link (http://www.cplusplus.com/reference/clibrary/ctime/localtime/) terias reparado que a funcão retorna: struct tm * localtime ( const time_t * timer ); Procurando no mesmo site por struct tm, chegarias a isto: http://www.cplusplus.com/reference/clibrary/ctime/tm/ É o que estás à procura? include <ai se te avio> Mãe () { }
Guest user14912 Posted December 27, 2010 at 01:44 AM Report #360236 Posted December 27, 2010 at 01:44 AM Não é que seja conveniente o meu comentário mas acho que bastava chegar ao google e colocar à lá portuguesa "obter hora +c" :fartnew2:
bubulindo Posted December 27, 2010 at 09:57 AM Report #360246 Posted December 27, 2010 at 09:57 AM Mas o google é muito lento e o assunto era urgente... LOLOL 😁 include <ai se te avio> Mãe () { }
geforce Posted December 27, 2010 at 08:24 PM Author Report #360368 Posted December 27, 2010 at 08:24 PM LOL
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now