[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 754
  • Last Modified:

Using DoDateTime

Utilizing "DoDateTime" as inserted with Dreamweaver, I am attempting to find a way to pull a part of a date out...

right now I have this: <%= DoDateTime((AFC_Results.Fields.Item("AFC_date").Value), 4, -1) %>

I want to pull JUST the YEAR out, and display the date as YYYY... any ideas?
0
NickJPhillips
Asked:
NickJPhillips
1 Solution
 
Ryan ChongCommented:
You need to customize your function...

try like either:

<%= right("0000" & Year(AFC_Results.Fields.Item("AFC_date").Value), 4)%>

or:

<%
   function getYYYY(v)
     on error resume next
     getYYYY = right("0000" & Year(v), 4)
   end function

%>

then:

<%= getYYYY(AFC_Results.Fields.Item("AFC_date").Value) %>
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now