title: Flex Compile Time Constants - Timestamp
body: <p>I'm trying to use <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_21.html" rel="nofollow noreferrer">Flex Compile Time Constants</a> to include the date and time the SWF was built (source control revision/timestamp such as SVN:Keywords is not sufficient for our needs, we need to know the actual build time, not the commit time).</p>
  
  <p>I've tried using actionscript (like the documentation suggests you should be able to):</p>
  
  <pre><code>-define+=COMPILE::Timestamp,"new Date()"
  </code></pre>
  
  <p>But this gives "The initializer for a configuration value must be a compile time constant"</p>
  
  <p>I've tried getting it to drop to shell and use the date command (using various single and double quote configurations), for example:</p>
  
  <pre><code>-define+=COMPILE::Timestamp,`date +%Y%m%d%H%M%S` 
  </code></pre>
  
  <p>I can only get it to work with simple strings and simple constant expressions (eg, I can do <code>4-2</code> and it'll be <code>2</code> at runtime.  But I can't get it to do anything whose value wouldn't be explicitly known at the time I declare the define.</p>
  
  <p>Has anyone had any luck with something like this?</p>