nevadaflyfisher
Programmer
Good Morning,
I'd like to write one JavaScript function that will return formatted date/time values, with the format being different based on a passed argument. I'd then make two calls to the function from the same HTML page (rather than write a separate function for each different format.) What I've learned so far is that I can only make one call per page load. Is there a way to call the same function multiple times from the same page?
Here's my code so far:
Many thanks in advance,
Ken
I'd like to write one JavaScript function that will return formatted date/time values, with the format being different based on a passed argument. I'd then make two calls to the function from the same HTML page (rather than write a separate function for each different format.) What I've learned so far is that I can only make one call per page load. Is there a way to call the same function multiple times from the same page?
Here's my code so far:
Code:
<head>
<snip>
<script language="JavaScript" type="text/javascript" src="js/time.js"></script>
</snip>
</head>
<body>
<snip>
<script type="text/javascript">document.write(getDateString("local"))</script><br>
<script type="text/javascript">document.write(getDateString("utc"))</script>
</snip>
</body>
Many thanks in advance,
Ken