Return the current period formatter.

@return the current period formatter
513105
public PeriodFormatter getPeriodFormatter() {
    if (formatter == null) {
      formatter = ps.newPeriodFormatterFactory()
          .setLocale(localeName)
          .getFormatter();
    }
    return formatter;
  }
587612
@GET
    @Produces({ MediaType.TEXT_PLAIN })
    public String getTime() {
        return String.valueOf(System.currentTimeMillis());
    }
1063284
public String getFormatName() {

        String result = "";
        if ((m_formatHandler != null) && (m_formatHandler.getCurrentFormat() != null)) {
            result = m_formatHandler.getCurrentFormat().getName();
        }
        return result;
    }
1032851
public StringFormatter getFormatter() {
		if (formatter == null) {
                    ResourceBundle b = ResourceBundle.getBundle(UI_RESOURCE_BUNDLE_NAME, new UTF8Control());
			formatter = new StringFormatter(b, getLocale());
		}
		return formatter;
	}
1101664
public CalendarPeriod GetCalendarPeriod()
	{
		CalendarPeriod res = new CalendarPeriod();
		List<Period> periods = new ArrayList<Period>();
		for( int i = 0; i < this.periods.size(); i++ )
		{
			PeriodAssociative<T> p = this.periods.get( i );
			periods.add( new Period( p.getFrom(), p.getTo() ) );
		}
		// use merge to merge jointed periods...
		res.setPeriods( res._Merge( periods ) );

		return res;
	}
1316224
public static long getDurationFromPeriod(Every every) {
        if (!Strings.isNullOrEmpty(every.value())) {
            return toDuration(PERIOD_FORMATTER.parsePeriod(every.value()));
        }
        return -1;
    }
608032
public static Date getCurrentDateTime() {
        java.util.Calendar calNow = java.util.Calendar.getInstance();
        java.util.Date dtNow = calNow.getTime();

        return dtNow;
    }
15013
public function getSecond(): Period
    {
        $datepoint = $this->setTime(
            (int) $this->format('H'),
            (int) $this->format('i'),
            (int) $this->format('s')
        );

        return new Period($datepoint, $datepoint->add(new DateInterval('PT1S')));
    }
922355
public static DateFormat getAlignedFormat() {
		if (DATE_FORMAT instanceof SimpleDateFormat) {
			SimpleDateFormat sdf = (SimpleDateFormat) DATE_FORMAT;
			String pattern = sdf.toPattern()
					.replaceAll("M+", "MM")
					.replaceAll("d+", "dd")
					.replaceAll("h+", "hh")
					.replaceAll("H+", "HH");
			sdf.applyPattern(pattern);
			return sdf;
		} else {
			return DATE_FORMAT;
		}
	}
638056
@Override
  public DurationFormatter getFormatter() {
    if (f == null) {
      if (fallback != null) {
        fallback = fallback.withLocale(localeName).withTimeZone(timeZone);
      }
      formatter = getPeriodFormatter();
      builder = getPeriodBuilder();

      f = createFormatter();
    }
    return f;
  }
793474
public final String getFinishFormattedShort() {
        Granularity finishGran = this.interval.getFinishGranularity();
        return formatFinish(finishGran != null ? finishGran.getShortFormat()
                : null);
    }
531403
public static PeriodType weeks() {
        PeriodType type = cWeeks;
        if (type == null) {
            type = new PeriodType(
                "Weeks",
                new DurationFieldType[] { DurationFieldType.weeks() },
                new int[] { -1, -1, 0, -1, -1, -1, -1, -1, }
            );
            cWeeks = type;
        }
        return type;
    }
1208478
def get_period_strs(self, now=None):
        
        if now is None:
            now = self.dt.utcnow()

        year_str = "%04d" % now.year
        month_str = "%04d-%02d" % (now.year, now.month)
        day_str = "%04d-%02d-%02d" % (now.year, now.month, now.day)
        hour_str = "%04d-%02d-%02dT%02d" % (
            now.year, now.month, now.day, now.hour)

        # Note: The week number may be in the previous year during the last
        # days of the year.
        isocal = now.isocalendar()
        week_str = "%04d-W%02d" % (isocal[0], isocal[1])

        return {
            "year": year_str,
            "month": month_str,
            "day": day_str,
            "hour": hour_str,
            "week": week_str,
        }
843735
public static PeriodType months() {
        PeriodType type = cMonths;
        if (type == null) {
            type = new PeriodType(
                "Months",
                new DurationFieldType[] { DurationFieldType.months() },
                new int[] { -1, 0, -1, -1, -1, -1, -1, -1, }
            );
            cMonths = type;
        }
        return type;
    }
217316
public static BasicPeriodFormatterService getInstance() {
        if (instance == null) {
            PeriodFormatterDataService ds = ResourceBasedPeriodFormatterDataService
                    .getInstance();
            instance = new BasicPeriodFormatterService(ds);
        }
        return instance;
    }
23114
public com.google.api.ads.admanager.axis.v201902.PeriodType getValuePeriodType() {
        return valuePeriodType;
    }
1260375
public static final KeyUpHandler getFormatStrKeyUpHandler() { // NOPMD it's thread save!
    if (HandlerFactory.formatStrKeyUpHandler == null) {
      synchronized (DecimalKeyPressHandler.class) {
        if (HandlerFactory.formatStrKeyUpHandler == null) {
          HandlerFactory.formatStrKeyUpHandler = new FormatKeyUpHandler<>();
        }
      }
    }
    return HandlerFactory.formatStrKeyUpHandler;
  }