Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
format datuma

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
jojo



Joined: 27 Jan 2005
Posts: 1591
Location: insula aurea

PostPosted: 20.12.2005 14:09    Post subject: format datuma Add user to your forum ignore list Reply with quote

pokušavam svakako al nikako da mi promijeni format datuma, redak ide ovako nekako

INSERT INTO tablica (datum,nešto,nešto) VALUES (now(),'".$nešto."','".nl2br($nešto)."')

usput da pitam i koja je funkcija koja uzima iz polja u tablici u kojem je textualni zapis prvih X riječi?

_________________
deviant / malomorgen / videoholik / cimer fraj
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Granda



Joined: 11 Aug 2005
Posts: 51

PostPosted: 20.12.2005 15:06    Post subject: Add user to your forum ignore list Reply with quote

mislim da je funkcija koju tražiš za insert datuma : curdate()

insert into tablica1 set
date = curdate(),
date2 = curdate();

Druga funkcija koju tražiš je trim()

potraži na PHP site-u.
Back to top
View user's profile Send private message
jojo



Joined: 27 Jan 2005
Posts: 1591
Location: insula aurea

PostPosted: 20.12.2005 15:12    Post subject: Add user to your forum ignore list Reply with quote

nisam baš to htjela nego čisto mijenjati format prikaza datuma i vremena u custom, recimo
u d.m.y. hh:mm

ono drugo što sam tražila je ovo:

$words=split ('[ ]+', $text);
if (sizeof($words) > 50) {
$words = array_slice($words, 0, 50);
}
$novi=implode($words, ' ');

_________________
deviant / malomorgen / videoholik / cimer fraj
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Granda



Joined: 11 Aug 2005
Posts: 51

PostPosted: 20.12.2005 15:34    Post subject: Add user to your forum ignore list Reply with quote

function dateconvert($date,$func) {
if ($func == 1){ //insert conversion
list($day, $month, $year) = split('[/.-]', $date);
$date = "$year-$month-$day";
return $date;
}
if ($func == 2){ //output conversion
list($year, $month, $day) = split('[-.]', $date);
$date = "$day/$month/$year";
return $date;
}
Back to top
View user's profile Send private message
smasher



Joined: 10 Jan 2004
Posts: 229
Location: Zaprešić

PostPosted: 20.12.2005 15:42    Post subject: Add user to your forum ignore list Reply with quote

jojo wrote:
nisam baš to htjela nego čisto mijenjati format prikaza datuma i vremena u custom, recimo
u d.m.y. hh:mm


jel možda misliš ovo?
Code:
$your_date = date("d.m.Y. H:i", time());


a možda sam krivo shvatio... Wink

Last edited by smasher on 20.12.2005 15:45; edited 1 time in total

_________________
http://3DHR.net - Srce hrvatskih 3d artista
http://www.Rhino3DHelp.com
Back to top
View user's profile Send private message Visit poster's website
jojo



Joined: 27 Jan 2005
Posts: 1591
Location: insula aurea

PostPosted: 20.12.2005 15:43    Post subject: Add user to your forum ignore list Reply with quote

thanx

_________________
deviant / malomorgen / videoholik / cimer fraj
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group