# Graphica DateTimeStamp

**URL:** <https://discourse.processing.org/t/graphica-datetimestamp/5450>\
**Category:** Libraries\
**Created:** [November 11, 2018, 2:53pm UTC](https://discourse.processing.org/t/graphica-datetimestamp/5450 "2018-11-11T14:53:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pacolux](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/pacolux/32/1893_2.png) [@pacolux](https://discourse.processing.org/u/pacolux)\
**Post date:** [November 11, 2018, 2:53pm UTC](https://discourse.processing.org/t/graphica-datetimestamp/5450/1 "2018-11-11T14:53:39Z")

</div>

Does anyone know if the Graphica library can have a datetimestamp as one of its axis? I see years being used in an example but cannot seem to find datetime used.

Tia!

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [November 11, 2018, 3:58pm UTC](https://discourse.processing.org/t/graphica-datetimestamp/5450/2 "2018-11-11T15:58:20Z")

</div>

you can set any text you want, formatting ?

```auto

import grafica.*;
int nPoints = 10;

void setup() {
  size(520, 400);
  background(150);
  GPointsArray points = new GPointsArray(nPoints);

  for (int i = 0; i < nPoints; i++) points.add(i, 10*noise(0.1*i));
  // Create a new plot and set its position on the screen
  GPlot plot = new GPlot(this);
  plot.setPos(10, 10);
  // plot.setOuterDim(500,300);
  plot.setPoints(points);
  plot.setTitleText("x tick label test");
  plot.getXAxis().setAxisLabelText("time");
  // plot.getXAxis().setOffset(20);
  plot.getXAxis().setRotateTickLabels(true);
  plot.getYAxis().setAxisLabelText("random");
  println(plot.getXAxis().getTicks());
  println(plot.getXAxis().getTicks().length);
  // String[] xticks = new String[nPoints];
  // String[] xticks = {"a","b","c","d","e"};
  String[] xticks = new String[plot.getXAxis().getTicks().length]; //{"a","b","c","d","e"};
  for (int i = 0; i < plot.getXAxis().getTicks().length; i++) 
    xticks[i] = year()+"-"+month()+"-"+day()+" "+hour()+":"+minute()+":"+second();
  plot.getXAxis().setTickLabels(xticks);
  // plot.getXAxis().setDrawTickLabels(true);
  plot.defaultDraw();
}

```

![snap-081](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/f/f1b3a30fe9edee2b0557f84c981e6acbf8b3f63e.jpeg)
