Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Labeling with Dates

$
0
0
Hello everyone,

I'm trying to label a feature class that has a date field in it. My problem is that I only want to get the mm/dd/yyyy, but when I try to label it through python it will bring up the time as well. I tried using an array on dateOff (the date field), but I still run into the issue of it grabbing part of the time. My question is, what do I need to do in my python script to only get the date information and not the time information to show up in my label.

Here is a sample of what I have done so far.
Code:

import os

def FindLabel ( [Cause_Of_Outage] , [Date_Off] ):
  outageType = [Cause_Of_Outage]
  dateOff = [Date_Off]
  return 'Outage Type: ' + outageType + os.linesep +'Date Off: ' + dateOff[0:10]


Viewing all articles
Browse latest Browse all 2485

Latest Images

Trending Articles



Latest Images