.dsy:it.
Show 150 posts per page

.dsy:it. (http://www.dsy.it/forum/)
- Forum De Bell Tolls (http://www.dsy.it/forum/forumdisplay.php?forumid=7)
-- [TECWEB] Problema con date e database (http://www.dsy.it/forum/showthread.php?threadid=14123)


Posted by ripe on 13-10-2004 15:33:

[TECWEB] Problema con date e database

Sto realizzando un CMS usando Asp.Net e (non ridete, ma le esigenze di chi userà questo sistema sono molto basilari) Access. Vorrei dare la possibilità agli amministratori, di inserire nuovi utenti nel sistema: allora genero dinamicamente il solito modulo con i campi da compilare tra cui la data di inserimento nel sistema che viene generata automaticamente. La formatto del tipo "dd/MM/yyyy" e quando la visualizzo in un'etichetta del modulo tutto funziona.... ma quando eseguo l'inserimento SQL nel database, se il giorno è maggiore o uguale a 13 (quindi non c'è ambiguità del mese) viene inserita giusta, altrimenti il formato passa a quello americano mese/giorno/anno. Le ho provate tutte: con formattazione manuale, usando il formato ISO yyyy/MM/dd. Niente da fare!

Avete qualche idea?

Grazie!

Ale

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»


Posted by nous on 13-10-2004 15:40:

Che linguaggio usi? C#?

__________________
Cristian,il Nous che invoglia ^_^

"La capa è troppo in la,e la sbarba è troppo giovane..mi sa che qua si va in bianco"
Ryo Saeba (City Hunter)


Posted by ripe on 13-10-2004 15:47:

VB! :)
Ti prego, dimmi che hai una soluzione... mi sembra di impazzire!

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»


Posted by korn on 13-10-2004 17:32:

Nel vecchio ASP questo genere di problemi si risolveva con la SetLocale, in .NET non lo so.

Off-Topic:

W I TIMESTAMP!!!!!!!!! :rotfl:

__________________
» Collect some stars to shine for you, and start today ‘cause there are only a few. _ (In Flames)
» Don't stop for nothing, it's full speed or nothing! I'm taking down, you know, whatever is in my way! _ ('tallica)
» I am my own god, I do as I please. _ (Pain)
» Ninetynine, ninetynine knives! Ninetynine knives inside! Nobody gets out alive! _ (The Haunted)
Web: http://www.negativesignal.com - ICQ# 171585477 - Death to software patents! And TCPA too! "e uno!", diceva il boia.


Posted by ripe on 18-10-2004 17:36:

Per chi fosse interessato, ho risolto il problema in modo poco ortodosso.

Ora memorizzo le date in semplici campi di testo da 8 caratteri, con il seguente formato:
18/10/2004 --> 20041018

In questo modo (non me n'ero mai accorto! :asd: ) le date sono già ordinate/pronte per essere elaborate, e se voglio visualizzarle uso una classe helper che ho scritto apposta per estrarre anno, mese e giorno con i relativi separatori.

:approved:

Ciaoooooo

ripe

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»


All times are GMT. The time now is 00:23.
Show all 5 posts from this thread on one page

Powered by: vBulletin Version 2.3.1
Copyright © Jelsoft Enterprises Limited 2000 - 2002.