Αρχή :: Ενότητες :: Scripting :: Απαντήσεις     
 

Forum

Date Format in ASP - Από {manrj}

Giati eno xtizo tin imerominia stin asp gia to query mou, apo elliniko XP client exo allo apotelesma?

Euxaristo!

 


Απάντηση από:_tasos

Είναι πιθανό η ημερομηνία να έχει άλλη μορφή.
Αυτό που είχα σαν πρόβλημα είναι να παίρνω την ημερομηνία σε μορφή MM/DD/YYYY και όχι DD/MM/YYYY όπως περιμένεις.
Αν όντως είναι αυτό το πρόβλημα σου, ψάξε μέσα στο tip.gr,
έχει συζητηθεί αρκετά σε παλιότερα post.

Απάντηση από:Alex

<%
function MediumDate (str)
Dim aDay, aMonth, aYear
aDay = Day(str)
aMonth = Monthname(Month(str),True)
aYear = Year(str)
MediumDate = aDay & "-" & aMonth & "-" & aYear
end Function

function formatDate(str)

formatDate=day(str)&"/"&month(str)&"/"&year(str)

end function
%>

Απάντηση από:manrj

Exo to parakato Query:

select * from tableName where start_date >=#01/01/2004# and start_date < #02/01/2004# order by start_date

Auto fernei oles tis egrafes tou Ianouariou
Doulevi mia xara oxi omos kai an to kaleseis apo XP Elliniko

Otan to kano response.write kai to koitao apo XP Elliniko tote
to vlepo etsi:

select * from tableName where start_date >=#01/01/2004# and start_date < #01/02/2004# order by start_date

Tin imerominia tin ftiaxno me antistoixes functions san autes pou mou esteile o Alex kai xrisimopoio ta parakato sto include arxeio:

Session.CodePage = 1253
Session.LCID = 1032


Euxaristo!



tip: Unlimited Profesional ASP.NET 4.0 Hosting.+ MSSQL με 2,30 € το μήνα * F5 για νέο tip

   Πίσω στην προηγούμενη σελίδα






Η Εταιρία | Web Hosting | Domain names | Web Information | Υπηρεσίες | Resellers | Υποστήριξη |
Copyright © 2007–09 4GR.NETWORKS, All rights reserved.