terça-feira, 16 de setembro de 2025
Home
Artigos
Banco de Dados
Access
Firebird
Microsoft SQL Server
MySql
Oracle
Sybase
BI
QlikView
Dicas de Internet
e-business
Hardware
Multimídia
Flash
Programação
.NET/ASP.NET
.NET/C#
.NET/Framework
.NET/VB.NET
ASP
C/C++
Clipper
Cobol
CSS
Delphi
Java
Javascript
JSP
Palm
Perl
PHP
Shell
Visual Basic
WAP
Redes
Segurança
Servidores E-mail
Servidores Web
Apache
Microsoft IIS
Sistemas Operacionais
AIX
DOS
HPUX
Linux
Palm OS
Solaris
True64
Windows 7
Windows 9X
Windows NT
Windows Vista
Windows XP
Software Review
PC
Storages
Veritas VM
Conteúdo atual do site:
[807] ítens, entre artigos, funções e documentos.
Pesquisa Rápida:
Últimos 3 acessos:
Alexandre Neves 03/03/2015 11:08:01 167 acesso(s) alexandre neves 03/03/2015 11:06:42 1 acesso(s) Marcelo Torres 21/01/2015 15:24:53 61 acesso(s)
Opções:
Listagem completa Listagem simples
Ranking Colaboradores:
Adenilton Rodrigues - [304] Alexandre Neves - [61] Douglas Freire - [54] Marcelo Giovanni - [53] Marcelo Torres - [43] Angelita Bernardes - [31] Addy Magalhães Cunha - [28] Manuel Fraguas - [24] Ludmila Valadares - [20] Marcelo Capelo - [18]
Otimo artigo mostrando como trabalhar com datas em scripts ASP
<% strDate = Now() %> <%= Date() %> Produces: 11/28/2001 <%= Now() %> Produces: 11/28/2001 2:54:07 PM <%= Time() %> Produces: 2:54:07 PM <%= FormatDateTime(strDate, 0) %> Produces: 11/28/2001 2:54:07 PM <%= FormatDateTime(strDate, 1) %> Produces: Wednesday, November 28, 2001 <%= FormatDateTime(strDate, 2) %> Produces: 11/28/2001 <%= FormatDateTime(strDate, 3) %> Produces: 2:54:07 PM <%= FormatDateTime(strDate, 4) %> Produces: 14:54 <%= Year(strDate) %> Produces: 2001 <%= Month(strDate) %> Produces: 11 <%= MonthName(Month(strDate)) %> Produces: November <%= MonthName(Month(strDate), 1) %> Produces: Nov <%= Day(strDate) %> Produces: 28 <%= WeekDay(strDate) %> Produces: 4 <%= WeekDayName(WeekDay(strDate)) %> Produces: Wednesday <%= WeekDayName(WeekDay(strDate), 1) %> Produces: Wed <%= Minute(strDate) %> Produces: 54 <%= Second(strDate) %> Produces: 7 <%= DateAdd("d", 1, strDate) %> Produces: 11/29/2001 2:54:07 PM <%= DateAdd("d", -1, strDate) %> Produces: 11/27/2001 2:54:07 PM <%= DateDiff("d", "1/1/2000", strDate) %> Produces: 697 <%= Day(strDate) & "/" & Month(strDate) & "/" & Year(strDate) %> Produces: 28/11/2001 <%= WeekDayName(WeekDay(strDate)) & ", " & Day(strDate) & " " & MonthName(Month(strDate)) & ", " & Year(strDate) %> Produces: Wednesday, 28 November, 2001 Using Dates in SQL Statements One of the most common uses of a date in a SQL statement is to tag a database entry with a creation date/time. You can use the getdate() statement to very easily add the current date/time as follows: INSERT INTO YourDatabaseTable VALUES DateCreated = getdate() Some of the ASP (VBScript) functions you'll find useful Click on the function name for full usage instructions. Date - Returns the current server date. Now - Returns the current date and time according to the setting of the server's system date and time. Time - Returns a Variant of subtype Date indicating the current system time. Year - Returns the Year part of a date or date/time value. Month - Returns a whole number between 1 and 12, inclusive, representing the month of the year. MonthName - Returns a string indicating the specified month. Day - Returns the Day part of a date or date/time value. Weekday - Returns a whole number representing the day of the week. WeekdayName - Returns a string indicating the specified day of the week. Hour - Returns the Hour part of a date/time value. Minute - Returns the Minute part of a date/time value. Second - Returns the Second part of a date/time value. FormatDateTime - Returns an expression formatted as a date or time. CDate - Convert a String datatype to a Date datatype. DateAdd - Returns a date to which a specified time interval has been added. DateDiff - Returns the number of intervals between two dates. DatePart - Returns the specified part of a given date. DateSerial - Returns a Variant of subtype Date for a specified year, month, and day. DateValue - Returns a Variant of subtype Date. IsDate - Returns a Boolean value indicating whether an expression can be converted to a date. TimeSerial - Returns a Variant of subtype Date containing the time for a specific hour, minute, and second. TimeValue - Returns a Variant of subtype Date containing the time. Quebra-Linha Colaborador..: Adenilton Rodrigues Categoria(s).: ASP; Data.........: 11/04/2002 15:37:00 Visualizado..: 403 vezes Fonte........: http://www.asp-help.com/articles/dates.asp
Adenilton Rodrigues
Últimos Artigos deste colaborador Aplicação Intraweb com Main Menu e Frames - 16/05/2005 20:37:49 SQL em tabelas com Join em Access - 24/01/2005 21:06:59 Descarregando DLL's ISAPI/ACTIVEX/INTRAWEB - 10/12/2004 22:52:37
Últimos Artigos desta categoria Gerador de Codigo de Verificação REDECARD - 14/05/2008 23:53:10 Gerar um Excel apartir de um ASP - 18/07/2007 14:11:57 LongIP para StringIP - 11/02/2005 18:00:05
40 pessoa(s) on-line neste site.