title: How can a time function exist in functional programming?
body: <p>I've to admit that I don't know much about functional programming. I read about it from here and there, and so came to know that in functional programming, a function returns the same output, for same input, no matter how many times the function is called. It's exactly like a mathematical function which evaluates to the same output for the same value of the input parameters which involves in the function expression.</p>
  
  <p>For example, consider this:</p>
  
  <pre><code>f(x,y) = x*x + y; // It is a mathematical function
  </code></pre>
  
  <p>No matter how many times you use <code>f(10,4)</code>, its value will always be <code>104</code>. As such, wherever you've written <code>f(10,4)</code>, you can replace it with <code>104</code>, without altering the value of the whole expression. This property is referred to as <a href="http://en.wikipedia.org/wiki/Referential_transparency_(computer_science)" rel="noreferrer">referential transparency</a> of an expression.</p>
  
  <p>As Wikipedia says (<a href="http://en.wikipedia.org/wiki/Functional_programming" rel="noreferrer">link</a>),</p>
  
  <blockquote>
    <p>Conversely, in functional code, the output value of a function depends only on the arguments that are input to the function, so calling a function f twice with the same value for an argument x will produce the same result f(x) both times.</p>
  </blockquote>
  
  <p>Can a time function (which returns the <em>current</em> time) exist in functional programming?</p>
  
  <ul>
  <li><p>If yes, then how can it exist? Does it not violate the principle of functional programming? It particularly violates <a href="http://en.wikipedia.org/wiki/Referential_transparency_(computer_science)" rel="noreferrer">referential transparency</a> which is one of the property of functional programming (if I correctly understand it).</p></li>
  <li><p>Or if no, then how can one know the current time in functional programming?</p></li>
  </ul>