Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

leolimasbc

mes das datas

Recommended Posts

e ae galera, estou com um problema mto doido, q naum consigo entender,

se alguem souber o que é e puder me ajudar agradeço:

 

preciso colocar numa variavel o mes de certa data (as vezes a atual), só q qnd é o mes atual

 

mes = month(Date)

 

ela funciona normal,

porém qnd eu vou pegar o mes da data q eu passei pela string da pau

 

mes = month(request.querystring("data"))

 

Ela sempre responde 12 independente do mes q seja.

alguem tem idéia do seja?

 

valew

Compartilhar este post


Link para o post
Compartilhar em outros sites

ta estranho isso...sempre vem 12???voce tem algo online já???

Compartilhar este post


Link para o post
Compartilhar em outros sites

acha que pode ser algum problema com o IIS?

não... http://forum.imasters.com.br/public/style_emoticons/default/no.gif poe o trecho do codigo que imprime isso

Compartilhar este post


Link para o post
Compartilhar em outros sites

<%

 

InputDate = Cdate(request.querystring("data"))

if InputDate = "" then InputDate = Date()

 

mes = month(InputDate)

ano = year(InputDate)DayNum = Int(DatePart("d",InputDate))

WeekNum = Int(DatePart("ww",InputDate))

DayWeekNum = Int(DatePart("w",InputDate,vbMonday))

MonthNum = Int(DatePart("m",InputDate))

YearNum = Int(DatePart("yyyy",InputDate))

 

Select Case MonthNum

Case 4, 6, 9, 11 'months with 30 Days

MonthDays = 30

Case 2 ' == Leap year calculations for February: the rule is that all years that are evenly divisible by 400 or are evenly divisible by 4 and NOT divisible by 100 are leap years

leap1 = YearNum Mod 400

If leap1 = 0 Then

MonthDays = 29

Else

leap2 = YearNum Mod 4

leap3 = YearNum Mod 100

If leap2 = 0 And test3 > 0 Then

MonthDays = 29

Else

MonthDays = 28

End If

End If

Case Else 'all other months

MonthDays = 31

End Select

%>

 

 

<%=mes%>-<%=ano%>

<BR><BR>

 

<TABLE border="0">

<TR>

<%for x = 1 to MonthDays%>

<%Data = CDate(x & "/" & MonthNum &"/"& YearNum)%>

<TD width="20" bgcolor="#EBEBEB">

<CENTER>

<FONT face="arial" SIZE="1">

<%=ucase(left(weekdayname(weekday(data)),1))%>

<BR>

<%=x%>

</CENTER>

</TD>

<%next%>

</TD>

</TR>

</TABLE>

 

 

está td ae o q eu tenho na pag por enquanto.

 

em vermelho é o q ta respondendo 12, ahh e o ano ele responde 1899, sempre...

Compartilhar este post


Link para o post
Compartilhar em outros sites

tira este CDATEInputDate = Cdate(request.querystring("data"))e veja o que acontece...ainda ta estranho

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.