Elipse Knowledgebase



KB-33057: Obtendo dados individuais de data e hora

Descrição:

Como obter individualmente as informações da data atual (dia, mês, ano, hora, minuto, e segundo)?

Solução:

Para isso, pode-se usar o comando now, que retorna o "momento" atual com data e hora em uma variável do subtipo datetime. Como se deseja obter cada valor individualmente, deve-se usar as funções day, month, year, hour, minute e second. O script abaixo exemplifica esta operação:

dia = day(now)
mes = month(now)
ano = year(now)
hora = hour(now)
minuto = minute(now)
segundo = second(now)


Related Articles

No related articles were found.

Attachments

No attachments were found.

Visitor Comments

No visitor comments posted. Post a comment

Post Comment for "KB-33057: Obtendo dados individuais de data e hora"

To post a comment for this article, simply complete the form below. Fields marked with an asterisk are required.

   Name:
   Email:
* Comment:
* Enter the code below:

 

Article Details

Last Updated
9th of March, 2010

Autor
Guilherme Taschetto

Would you like to...

Print this page  Print this page

Email this page  Email this page

Post a comment  Post a comment

 Subscribe me

Subscribe me  Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF


User Opinions

No users have voted.

How would you rate this answer?




Thank you for rating this answer.

Continue