Forum Moderators: open

Message Too Old, No Replies

vb to js

         

franches

7:50 am on Nov 2, 2004 (gmt 0)

10+ Year Member



hi,
i have a problem with the vb code. i am trying to rewrite it in js but did not succeed. if you would ask me why i am doing it in js it's because I'm using php and mysql and in my database the date format is yyyy-mm-dd. and i've noticed that vb is mm-dd-yyyy. and i'm having hard time comparing the dates.

how would rewrite this vb code in js?
filMonth=Month(now)
filYear=Year(date)

Lance

10:24 am on Nov 2, 2004 (gmt 0)

10+ Year Member



See if this gets you what you need:

<script type="text/javascript">
var today = new Date();
var filMonth = today.getMonth() + 1;
var filYear = today.getYear();

var filDay = today.getDate();

var msgToday = "Today is: " + filMonth + "/" + filDay + "/" + filYear + " in the U.S.\n"
msgToday += "and " + filDay + "/" + filMonth + "/" + filYear + " elsewhere."

alert(msgToday);
</script>

franches

7:59 am on Nov 5, 2004 (gmt 0)

10+ Year Member



thank you very much!