Avatar billede guzzie Nybegynder
19. april 2001 - 16:22 Der er 20 kommentarer og
1 løsning

dato format

hey there

I have a dato colume that I use
like this
<%=dato%> from which I get the full date and time
how would I write it if I wanted the day of the week and the time only ????
can I set it up in my DB or does it require more than that
any help would be great
Guzzie
Avatar billede cape Nybegynder
19. april 2001 - 16:25 #1
<\'%= WeekDayName(WeekDay(strDate)) %>
And
<\'%= FormatDateTime(strDate, 4) %>

Avatar billede sone Nybegynder
19. april 2001 - 16:25 #2
<%=time%> extraxts time only.
Avatar billede tdaugaard Nybegynder
19. april 2001 - 16:25 #3
<%=DayOfWeek(Dato) & \" @ \" & FormatDateTime(Dato, vbLongTime)%>

If i recall correctly ..
Avatar billede cape Nybegynder
19. april 2001 - 16:25 #4
it doesn´t require any database changes !
Avatar billede tdaugaard Nybegynder
19. april 2001 - 16:26 #5
sone:> given that he wrote \"dato\" and not Date i assume he has pulled this from a database, thus he cannot use Time to get the time from the date string.
Avatar billede guzzie Nybegynder
19. april 2001 - 16:31 #6
hey again

tdaugaard/  i tried your idea and got this
Microsoft VBScript runtime error \'800a000d\'

Type mismatch: \'DayOfWeek\'

/unrealcore_new/admin/news_main_news.asp, line 72



hey cape
do I just change <%=dato%>
to
<\'%= WeekDayName(WeekDay(strDate)) %>
im not quite sure what you mean ?

guzzie
Avatar billede tdaugaard Nybegynder
19. april 2001 - 16:33 #7
guzzie:> yeah ... mine didn\'t work :-(
Avatar billede guzzie Nybegynder
19. april 2001 - 16:33 #8
I tried yours to cape
and all it did was show the line you gave me ?
Guzzie
Avatar billede guzzie Nybegynder
19. april 2001 - 16:34 #9
tda// should I maybe use javascript
of is there a funchion one should use ??
any thoughts
Avatar billede cape Nybegynder
19. april 2001 - 16:35 #10
Nope !
Set A varible(StrDate) to <%=Date%>
<\'%= WeekDayName(WeekDay(StrDate)) %>
Then it works !

Avatar billede guzzie Nybegynder
19. april 2001 - 16:39 #11
//cape
Im not quite sure how I make a variable
is it like this

<%
StrDate = \" & Dato & \"
%>
?????
thanks
Avatar billede cape Nybegynder
19. april 2001 - 16:40 #12
Like this
StrDate = Rs.Fields(\"DATO\").Value
and
then
<%= WeekDayName(WeekDay(StrDate))%>

Avatar billede guzzie Nybegynder
19. april 2001 - 16:44 #13
if this helps any
what I am trying to do is this
have my database show the day of the week and the time
if the next item from the database is from the same day then only the time gets shown and so on and so forth ?
Avatar billede cape Nybegynder
19. april 2001 - 16:46 #14
Well ok !
But doesn´t the above work `?
Avatar billede guzzie Nybegynder
19. april 2001 - 16:48 #15
//cape hey there

I just tried what you wrote and it only showed the day of the week ? and not the time
guzzie :)
Avatar billede cape Nybegynder
19. april 2001 - 16:53 #16
Yes - That´s right !

and <\'%= FormatDateTime(strDate, 4) %> will give you the time !!

Avatar billede guzzie Nybegynder
19. april 2001 - 17:04 #17
hmmm
I write it like this
<%= WeekDayName(WeekDay(StrDate))%> <%= FormatDateTime(strDate, 4) %>

and all my database entries get the same day
torsdag  and the same time 00:00
sniff
Guzzie
Avatar billede cape Nybegynder
19. april 2001 - 17:10 #18
Do this !
While Not Rs.EOF
StrDate = Rs.Fields(\"DATO\").Value
....<%= WeekDayName(WeekDay(StrDate))%> and so on...
Rs.MoveNext()
Wend
....

Avatar billede guzzie Nybegynder
19. april 2001 - 17:33 #19
thanks cape
btw using Wend is not nessacery
I tried that and it didnt work
but without it it did
thanks very much
Guzzie
Avatar billede guzzie Nybegynder
19. april 2001 - 17:36 #20
hmmmm
something else cape

all the entries in my database r now shown correctly
how ever if I add a new entry it still gets shown the day of the week and the time as 00:00
any ideas ??
Avatar billede guzzie Nybegynder
19. april 2001 - 17:47 #21
never cape my asp script
was set as Date() and not Now()
:)
thanks again
Guzzie
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester