osk Posted January 11, 2006 Report Share Posted January 11, 2006 (edited) Kādu funkciju labāk izmantot datuma un laika reģistrēšanai? Man vajag zināt datumu un laiku kādā ir noticis ieraksts, kas ātrāk tiek apstrādāts date vai time? mysql un es domāju int formā Edited January 11, 2006 by osk Link to comment Share on other sites More sharing options...
Grey_Wolf Posted January 11, 2006 Report Share Posted January 11, 2006 ??? 1. kur tu vinju glabaasi? 2. kaadaa formaataa? Link to comment Share on other sites More sharing options...
bubu Posted January 11, 2006 Report Share Posted January 11, 2006 Vai nu DATETIME vai TIMESTAMP. Link to comment Share on other sites More sharing options...
Grey_Wolf Posted January 11, 2006 Report Share Posted January 11, 2006 osk--> viss atkariigs ko peec tam veelies dariit.. Kaapeec tieshi INT? SQL vispaar datumus glabaa savaa formaataa.... ja tekosho pie katras izmainjas tad TIMESTAMP ja tekosho un pie katraam izmainjaam nevajag apdeitot tad lauks DATETIME un ierakstam izmantojam NOW()... Vieniigi rakstot kaadu citu datumu/laiku japielieto PHP date() ar pareiziem atribuutiem.. Link to comment Share on other sites More sharing options...
Paulinjsh Posted January 11, 2006 Report Share Posted January 11, 2006 Un ja vajaga updeitot? Vai tad ar to pašu NOW() un datetime nepietiek??? Link to comment Share on other sites More sharing options...
Grey_Wolf Posted January 11, 2006 Report Share Posted January 11, 2006 Paulinjsh --> NOW() ir SQL f-ja kas ievieto DATATIME laukaa tekosho datumu :) ja izmantosi lauka tipu kaa TIMESTAMP tad vinsh vienmeer ierakstiis tekosho datumu, pat ja vinju pie Update nenoraadiisi...standartaa kaa nokluseetais Ideali izmantot lai zinaatu peedeejo Updates laiku.... P.S. skjiet ka faktiski tiek izmantota taa pati NOW() f-ja tikai peec nokluseejuma... Link to comment Share on other sites More sharing options...
Paulinjsh Posted January 11, 2006 Report Share Posted January 11, 2006 A, skaidrīte.. Buģim znaķ :) Nu NOW() zinu :P Tas vairāk bija jautājums par to TIMESTAMP un DATETIME Link to comment Share on other sites More sharing options...
Blitz Posted January 12, 2006 Report Share Posted January 12, 2006 es izmantoju DATE("d.m.Y H:i") un glabaju TIMESTAMP... Tas nav isti pareizi? Link to comment Share on other sites More sharing options...
v3rb0 Posted January 12, 2006 Report Share Posted January 12, 2006 Blitz: timestamp lauks 'pats' sev var piešķirt vērtību - rezultāts ir tas pats kas timestamp_lauks = now() datumam un laikam ir datetime tipa lauks paredzēts. Link to comment Share on other sites More sharing options...
Recommended Posts