Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Tech > [C]data
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
fabpicca
jesus robot d'acciaio

User info:
Registered: May 2002
Posts: 2166 (0.26 al dì)
Location: Pieve Emanuele
Corso: Ticom
Anno:
Time Online: 12 Days, 23:12:28 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
[C]data

sto facendo dei trigger per postgresql usando il C.
Mi sono incappato in questo problema.

Uno dei dati che devo importare da un file di testo è una data espressa come numero di giorni dall'inizio del secolo. Io ho la necessità di trasformare questo numero in un SQL timestamp.

Qualcuno sa qualcosa in merito a delle librerie che fanno questo tipo di trasformazioni ?

grazie.

__________________
my website?|ubuntu linux|get Firefox|grazie Polonia |bagdad sour

"Come va che non ha le corna e le zampe di Caprone?" gli opposi. "Oh, Giuvà", mi disse il prete "adesso non si usa più.Satana è furbo". (I.Silone, Fontamara)
"Al giorno d'oggi non bisogna essere intelligenti, perchè la gente si offende" (un ubriacone)
"close your eyes / pay the price / for your paradise" (DM) "whatever you want to change/you'd better start changing it in your mind" (Transatlantic)

13-09-2005 11:19
Click Here to See the Profile for fabpicca Click Here to See the Blog of fabpicca Click here to Send fabpicca a Private Message Visit fabpicca's homepage! Find more posts by fabpicca Add fabpicca to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
yeah
.grande:maestro.

User info:
Registered: Nov 2003
Posts: 1644 (0.21 al dì)
Location: Cologno Monzese
Corso: Informatica Magistrale
Anno: II
Time Online: 12 Days, 21:36:41 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

strftime() può andar bene?

__________________
?

13-09-2005 20:19
Click Here to See the Profile for yeah Click here to Send yeah a Private Message Find more posts by yeah Add yeah to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fabpicca
jesus robot d'acciaio

User info:
Registered: May 2002
Posts: 2166 (0.26 al dì)
Location: Pieve Emanuele
Corso: Ticom
Anno:
Time Online: 12 Days, 23:12:28 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by yeah
strftime() può andar bene?


no, comunque ho risolto. Grazie mille

__________________
my website?|ubuntu linux|get Firefox|grazie Polonia |bagdad sour

"Come va che non ha le corna e le zampe di Caprone?" gli opposi. "Oh, Giuvà", mi disse il prete "adesso non si usa più.Satana è furbo". (I.Silone, Fontamara)
"Al giorno d'oggi non bisogna essere intelligenti, perchè la gente si offende" (un ubriacone)
"close your eyes / pay the price / for your paradise" (DM) "whatever you want to change/you'd better start changing it in your mind" (Transatlantic)

14-09-2005 08:24
Click Here to See the Profile for fabpicca Click Here to See the Blog of fabpicca Click here to Send fabpicca a Private Message Visit fabpicca's homepage! Find more posts by fabpicca Add fabpicca to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
yeah
.grande:maestro.

User info:
Registered: Nov 2003
Posts: 1644 (0.21 al dì)
Location: Cologno Monzese
Corso: Informatica Magistrale
Anno: II
Time Online: 12 Days, 21:36:41 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Potrei chiedere come? Potrebbe tornare utile :D

__________________
?

14-09-2005 20:57
Click Here to See the Profile for yeah Click here to Send yeah a Private Message Find more posts by yeah Add yeah to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fabpicca
jesus robot d'acciaio

User info:
Registered: May 2002
Posts: 2166 (0.26 al dì)
Location: Pieve Emanuele
Corso: Ticom
Anno:
Time Online: 12 Days, 23:12:28 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by yeah
Potrei chiedere come? Potrebbe tornare utile :D


allora...
il formato della data è quello Giuliano.
Per cui le date sono espresse come numero di giorni a partire dall'anno ...non mi ricordo.
Aggiungendo una costante che esprime il numero di giorni da li al 1 gennaio 1900 si arriva quindi ad una rappresentazione delle date come giorni dal 1900 a meno della costante aggiunta.

A questo punto ci sono due modi:
-perdere una giornata a farsi l'algoritmo di conversione.
-ricordarsi che la funzione di postgres Timestamp accetta in ingresso numeri come Jn dove J è la lettera J e n la data Giuliana. Si occupa lui poi della conversione.

Perccato che il secondo l'abbia scoperta dopo ;)

__________________
my website?|ubuntu linux|get Firefox|grazie Polonia |bagdad sour

"Come va che non ha le corna e le zampe di Caprone?" gli opposi. "Oh, Giuvà", mi disse il prete "adesso non si usa più.Satana è furbo". (I.Silone, Fontamara)
"Al giorno d'oggi non bisogna essere intelligenti, perchè la gente si offende" (un ubriacone)
"close your eyes / pay the price / for your paradise" (DM) "whatever you want to change/you'd better start changing it in your mind" (Transatlantic)

14-09-2005 21:03
Click Here to See the Profile for fabpicca Click Here to See the Blog of fabpicca Click here to Send fabpicca a Private Message Visit fabpicca's homepage! Find more posts by fabpicca Add fabpicca to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
yeah
.grande:maestro.

User info:
Registered: Nov 2003
Posts: 1644 (0.21 al dì)
Location: Cologno Monzese
Corso: Informatica Magistrale
Anno: II
Time Online: 12 Days, 21:36:41 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ok grazie :)

__________________
?

15-09-2005 20:02
Click Here to See the Profile for yeah Click here to Send yeah a Private Message Find more posts by yeah Add yeah to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 08:43.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.141 seconds (59.82% PHP - 40.18% MySQL) con 22 query.